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

16.7.0-alpha.2 warning #3

Closed
dancrew32 opened this issue Nov 19, 2018 · 0 comments
Closed

16.7.0-alpha.2 warning #3

dancrew32 opened this issue Nov 19, 2018 · 0 comments

Comments

@dancrew32
Copy link

dancrew32 commented Nov 19, 2018

Trying out react "react": "^16.7.0-alpha.2".

This project is currently on alpha.0.

https://github.com/mfrachet/use-socketio/blob/master/package.json#L36

I think these empty array literals as the second argument of useEffect are deprecated.

https://github.com/mfrachet/use-socketio/blob/d156cd954db952998f4bb3747f71df40bb58e5f3/src/useSocket.js#L9

https://github.com/mfrachet/use-socketio/blob/1fcd3d839fd0e3247c0dcd644d364275738e4a94/README.md#L25

https://github.com/mfrachet/use-socketio/blob/1fcd3d839fd0e3247c0dcd644d364275738e4a94/example/src/components/Feed.js#L21

The result in this warning:

react-dom.development.js:506 Warning: useEffect function must return a cleanup function or nothing.
    in Router (created by App)
    in r (created by App)
    in App
warningWithoutStack @ react-dom.development.js:506
commitHookEffectList @ react-dom.development.js:16041
commitPassiveHookEffects @ react-dom.development.js:16055
callCallback @ react-dom.development.js:149
...

I think the clean up function protocol may have changed?

https://reactjs.org/docs/hooks-effect.html#example-using-hooks-1

Edit: I see that they are memoized callbacks, so nevermind!.

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

1 participant