daniel-lundin / react-dom-confetti

Trigger confetti explosions on state transitions
624 stars 30 forks source link

Async loading causes dom style property gets parsed by React #6

Open mschipperheyn opened 7 years ago

mschipperheyn commented 7 years ago

get

Uncaught (in promise) Error: The style prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX. This DOM node was rendered by MyConfetti.

when I load this up. React 15.6.1

daniel-lundin commented 7 years ago

Can you provide more context? What is spacing?

mschipperheyn commented 7 years ago

So, I managed to get it working. It just doesn't work when I it's loaded in a component that is rendered by react-async-component. As long as I put react-dom-confetti in the sync loaded area of the site, it works fine.

daniel-lundin commented 7 years ago

Interesting, I haven't tried using with async component. Do you have any idea how to fix it? Don't have much experience with lazy loaded components.

mschipperheyn commented 7 years ago

Sorry, no.