Skip to content
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

React 18 (in StrictMode): Uncaught TypeError: Cannot read properties of null (reading 'animating') #123

Closed
josephmarkus opened this issue Apr 12, 2022 · 3 comments

Comments

@josephmarkus
Copy link

react-animate-height blows up in React 18. The library is used for an accordion component that animates on state toggle.

Code example
https://codesandbox.io/s/lingering-wood-tjnu2k?file=/src/App.js

Expected behavior

Clicking 'Open' should expand the component that is wrapped with <AnimateHeight />. Instead, it blows up

Possible Solution

🤷‍♂️ 😅

Steps to Reproduce (for bugs)

  1. Go to https://codesandbox.io/s/lingering-wood-tjnu2k?file=/src/App.js
  2. Click 'Open'
  3. Observe the error

Screenshots

6eb58856-55b0-4e4c-9192-52381e025f3b

Your Environment

  • Version used: 2.0.23
  • OS: MacOS
  • Browser: Chrome
  • Version: 100.0.4896.75

Additional context

n/a

@Stanko Stanko changed the title React 18: Uncaught TypeError: Cannot read properties of null (reading 'animating') React 18 (in StrictMode): Uncaught TypeError: Cannot read properties of null (reading 'animating') Apr 12, 2022
@Stanko
Copy link
Owner

Stanko commented Apr 12, 2022

Hello, thanks for letting me know. It seems it blows up when StrictMode is enabled. I'll look into it.
Cheers!

@Stanko Stanko closed this as completed in f2daad9 Apr 12, 2022
@Stanko
Copy link
Owner

Stanko commented Apr 12, 2022

Fixed in 2.1.0 🎉

Example:
https://codesandbox.io/s/ecstatic-leaf-x652u4

@josephmarkus
Copy link
Author

Amazing! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants