Tried to set the react environment by following the steps mentioned in this tutorial by @Jacek but seems like react hooks are not working correctly with this solution and whenever I use any of the react hooks it will log an error to the browser console: “Invalid hook calls” (Attached the screenshot of error logs)
Can anyone please let me know how can I fix this or what are the better ways to set up react with sage 9?
Is react.js setup with all its functionalities possible with sage 9?
I’ve checked older test project on Sage v9.0.9 and I set useState hook - and it looks it works fine.
It may be several reasons why the hooks not working on your side, so you should check it step by step.
Bellow I present my test component and dependencies, maybe it will help you somehow.
Right now I don’t have any active projects with Sage 9 and React, my current setup not working properly with older Node Sass etc. So it will be hard to me assist you to resolve this issue. Good luck!
Yes. I Checked and am able to fit it now.
So basically I just moved my app component rendering from the app.js file to the main.js and fixed the issue for me.