-
Notifications
You must be signed in to change notification settings - Fork 56
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+Node starter #42
Conversation
React+node+starter
Hello @MSaiKiran9! Thanks for your Pull Request! I read through the code, and I have a comment on the way that you fetch data in the frontend. It is generally not recommended to use a state and an effect to handle data fetching in React, as it causes unexpected issues. Data fetching can be quite a difficult problem in React, but there are some amazing libraries out there that handle the boilerplate for you, and I thought it might be an idea to implement one of them 😃 Notably:
Would you consider using refactoring this bit of code? Let me know if you need any help! Thanks ❤️ PS: Feel free to take a look at my project where I implement surrealdb.js with React myself 😃 |
@kearfy Thanks for letting me know I'm on it ! |
@kearfy I've refactored the code , I also forgot to put awaits while connecting to database and querying in the front-end's async block now it's okay , backend is also fine . I also used swr to update the frontend's UI every 10 seconds with the database data, if it has any updates . swr is really awesome .Thanks for the suggestion & let me know it it's okay now |
Hey @MSaiKiran9, your email got buried in my inbox, apologies! Will have a look tonight |
Awesome @MSaiKiran9, your changes look good, thanks! Updated the PR for you! |
Thankyou @kearfy |
Hey @MSaiKiran9 |
My contribution for the issue #35
This starter contains front-end and backend app made with react and nodejs . More info is available in the Readme: https://github.com/MSaiKiran9/react.nodejs_starter#readme
If there's something that should be improved, do let me know !