-
Notifications
You must be signed in to change notification settings - Fork 13
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
Events double fired in Root and @keyframes render to string with <Style> as [object Object] #10
Comments
@kurdin Thank you for posting this. I have a case where Could you clarify what you changed about the I am also trying to make sure I understand why the (For reference I am using this library with react and react-dom version 16.12.0.) p.s. I wonder if the change that eliminated the need for retarget might have been facebook/react#11927 which was applied to react-dom v16.5.0. edit: clarified patched revision. |
@jasco I am using latest react-dom as well. I did not notice any side effects of removing retarget. for createPortal change, I don't remember exactly why, maybe just to make things simpler I changed {state.shadowRoot
? createPortal(props.children, state.shadowRoot)
: props.children} to {state.shadowRoot && createPortal(props.children, state.shadowRoot)} I am always use
I have no idea, sorry, it works with latest React and that all I need. |
Thanks for reporting this issue. It's been awhile since I've had to dive deep into this codebase, so I'm still getting warmed up.
Changing it to remove the rendering of @kurdin could you please:
|
Yeah, you 100% right. I did not think about SSR, I don't need it for my app. I could not confirm that removing
Sorry that I could not help you more. |
I should correct myself to say that the patch I referenced was applied to 16.5.0 rather than suggesting that the problem affected that version. Just for testing purposes I confirmed that the onScroll synthetic event is triggered on a component within the shadow root in Chrome Version 79.0.3945.130 with react 16.12 after having removed the call to retarget. I haven't checked much beyond that and a couple of mouse events. |
This should be fixed by #12 and released in |
Thanks for nice lib and I found 2 issues with react-shade:
in simple app like this, I see
TEST Clicked
logged twice in consoleto fix this, I had to remove
retarget
method in Root.ts line 40// retarget(shadowRoot);
and fix line 57
{state.shadowRoot && createPortal(props.children, state.shadowRoot)}
@keyframe
or@media
props in<Style>
component, their content renders in style's tag as [object Object] because it has deeper nested object then regular style's rule. I found work around by moving all@keyframe
or@media
directly to<styles>
but I think you need to fix it somewhere ininternal/css.ts
by checking if value is Object then do another Object.keys if it is.The text was updated successfully, but these errors were encountered: