Giter Site home page Giter Site logo

Comments (6)

micchyboy avatar micchyboy commented on July 19, 2024 1

Thanks man. Its working fine now. Btw is there a way to only render once the css has been loaded?

from reactshadow.

Wildhoney avatar Wildhoney commented on July 19, 2024

@micchyboy it looks fine to me – there's no reason why it wouldn't work, considering the CSS is being successfully loaded. Check your network tab, and then inspect the shadow boundary to ensure it contains the expected style tag with your test.css content.

The props.theme is not part of ReactShadow but part of the example. It's simply pointing out that the include prop could be either an array or a string.

Valid props are:

static propTypes = {
    children: PropTypes.node.isRequired,
    include: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
    nodeName: PropTypes.string,
    boundaryMode: PropTypes.oneOf(['open', 'closed']),
    delegatesFocus: PropTypes.bool
};

from reactshadow.

Wildhoney avatar Wildhoney commented on July 19, 2024

👍 I wish – async React components is a deeper topic than ReactShadow, but we do have the class name approach, so you could hide your component until it's resolved.

from reactshadow.

herodrigues avatar herodrigues commented on July 19, 2024

@Wildhoney could you explain how to do that?

I'm using your library in a Chrome extension and it's essential that CSS documents load before the HTML content.

from reactshadow.

Wildhoney avatar Wildhoney commented on July 19, 2024

@herodrigues it's probably better to refer to the example.

In the example the component renders as soon as it can, however it appears only once the CSS has been loaded using the following CSS styles 👍

from reactshadow.

herodrigues avatar herodrigues commented on July 19, 2024

@Wildhoney I understood how fetching mechanism works in your library. I solved my issue by putting the desired CSS in my manifest.json file. Thus, the style is injected before the DOM is loaded.

from reactshadow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.