You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using <StrictMode> in React 18, the event handlers (onStart, onRest...) don't get called.
To Reproduce
In the linked StackBlitz project, you can see in the Console that only the console.logs in the useEffect hook get executed. The event listeners never get called. If you disable StrictMode in index.tsx, the event listeners get called as expected.
I second this, in my case, most of the hooks also exhibit this weird behavior such as useChain not triggering when components mount and events like onChange not firing in almost every hook. All of this occurs when reactStrictMode is set to true. It seems like strict mode has broken most of the functionality.
Which react-spring target are you using?
@react-spring/web
@react-spring/three
@react-spring/native
@react-spring/konva
@react-spring/zdog
What version of react-spring are you using?
9.7.3
What's Wrong?
When using
<StrictMode>
in React 18, the event handlers (onStart
,onRest
...) don't get called.To Reproduce
In the linked StackBlitz project, you can see in the Console that only the
console.log
s in theuseEffect
hook get executed. The event listeners never get called. If you disable StrictMode inindex.tsx
, the event listeners get called as expected.Expected Behaviour
Event listeners get called in StrictMode.
Link to repo
https://stackblitz.com/edit/stackblitz-starters-jphu4a?devToolsHeight=33&file=src%2FApp.tsx
The text was updated successfully, but these errors were encountered: