-
Notifications
You must be signed in to change notification settings - Fork 115
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 fail to initialize on react@^18
#2171
Comments
@markov00 I took a look into this and for some reason the redux state does not appear to be updating the parent dimensions. The When you get a chance could you take a look, cuz I'm out of ideas on what it could be. |
I did but not fully sure about my findings (I need to dig a bit more):
|
This issue appears to be caused by using the See same demo as above with |
Since kibana does not use |
Hi there, i am using elastic/charts 65.2.0 with Next13 and React18 and have the same error with onElementClick event. Is there any workaround or fix? |
@jonas080301 are you using |
Looks like NextJS uses React in Strict Mode. I got it to work by setting reactStrictMode to false in the next.config.ts! Thank you |
Glad to hear! I plan to dig deeper into the issue soon but for now that is the best workaround. |
When using charts with
react@^18
, the event callbacks for user interactions all fail to be called.This issue appears to be related to the
ResizeObserver
callingonResize
with an empty element (i.e.{ height: 0, width: 0 }
). Then theUPDATE_PARENT_DIMENSION
is updating to the zeroed dimensions and blocking the initialization of the event callbacks.See codesandbox example here
Notice not console logs of the events.
The text was updated successfully, but these errors were encountered: