refine
refine copied to clipboard
[BUG] create refine-app refine-mui shows warnings about useEffect usage out-of-the-box
Describe the bug
After creating a fresh starter project, warnings about useEffect hook usage are shown in the JS console. I am not sure which hooks are the cause.
Steps To Reproduce
- Create a fresh project using
npm create refine-app -- -o refine-mui tutorial
- Start the dev server using
npm run dev
- The JS-Console shows warnings:
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks
at xn (http://localhost:3000/static/js/bundle.js:98697:19)
at SnackbarProvider (http://localhost:3000/static/js/bundle.js:134363:24)
at http://localhost:3000/static/js/bundle.js:992:66
at InnerThemeProvider (http://localhost:3000/static/js/bundle.js:58619:70)
at ThemeProvider (http://localhost:3000/static/js/bundle.js:57687:5)
at ThemeProvider (http://localhost:3000/static/js/bundle.js:58638:5)
at App
Expected behavior
No warnings out-of-the-box.
Screenshot
No response
Desktop
- OS: MacOS
- refine-mui: 3.57.0
Mobile
No response
Additional Context
No response
Hey @cdietze!
Sorry for the issue. We've identified the issue; we get the values of the notificationProvider
inside a useMemo
in <Refine />
component. For the @pankod/refine-mui
's notificationProvider we've used notistack
but since its providing the functions with a hook, we're having this warning as a result. 🤦
We're aiming to release a quick fix 🚀
Hey @cdietze ,
We've released @pankod/[email protected]
. Could you approve this fix?
Yes, I can confirm: the warnings are gone. Thanks for the quick fix!