floating-ui / react-popper

🍿⚛Official React library to use Popper, the positioning library
https://popper.js.org/react-popper/
MIT License
2.51k stars 225 forks source link

Don't return a value in useEffect callback #367

Closed gnapse closed 4 years ago

gnapse commented 4 years ago

Not sure how no one has had this issue yet, but it made my code fail all over the place when upgrading from v1 to v2. The console was filled with these:

Warning: An effect function must not return anything besides a function, which is used for clean-up. You returned null. If your effect does not require clean up, return undefined (or nothing).

I tracked it down to this effect using an implicit-return arrow function for a callback.

FezVrasta commented 4 years ago

Thanks!