Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tip for making this work in React #4

Open
w0nche0l opened this issue May 29, 2020 · 2 comments
Open

Tip for making this work in React #4

w0nche0l opened this issue May 29, 2020 · 2 comments

Comments

@w0nche0l
Copy link

If anyone is using this in React, here's how you get React's HTML manipulation to work nicely with this library:

  <style scoped key={styleString}>
        {styleString}
  </style>
@samthor
Copy link
Owner

samthor commented Jun 22, 2020

Thanks! I might add this in the README.

@Kais3rP
Copy link

Kais3rP commented Mar 15, 2021

If anyone is using this in React, here's how you get React's HTML manipulation to work nicely with this library:

  <style scoped key={styleString}>
        {styleString}
  </style>

Great tip, spent 2 days trying to figure out how to inject scoped style tag in a React library, and couldn't make this work.

@samthor:
Definitely add this to the README or it won't work on React, while it works perfectly with a unique BUT also dynamic key attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants