inject-react-anywhere icon indicating copy to clipboard operation
inject-react-anywhere copied to clipboard

Better support for portals & CSS-in-JS

Open OlegWock opened this issue 2 years ago • 1 comments

Currently (because of mutation observer), it's possible to have FOUC when using CSS-in-JS because styles are copied with small delay. It might be good idea to implement custom Sheet and Tag to support multiple targets for injection.

Related:

https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/sheet/Sheet.ts#L78C41-L78C41 https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/sheet/Tag.ts#L5

OlegWock avatar Sep 05 '23 19:09 OlegWock

Fixes for styles-components, still need to work on emotion

Probably will need to implement custom cache https://github.com/emotion-js/emotion/blob/main/packages/cache/src/index.js

OlegWock avatar Sep 06 '23 09:09 OlegWock