scoped icon indicating copy to clipboard operation
scoped copied to clipboard

Tip for making this work in React

Open w0nche0l opened this issue 4 years ago • 2 comments

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>

w0nche0l avatar May 29 '20 22:05 w0nche0l

Thanks! I might add this in the README.

samthor avatar Jun 22 '20 01:06 samthor

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.

Kais3rP avatar Mar 15 '21 14:03 Kais3rP