Closed MSaiKiran9 closed 1 year ago
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
Hi @Ekwuno @kearfy can you confirm if this is okay
Hey @MSaiKiran9, your email got buried in my inbox, apologies! Will have a look tonight
Awesome @MSaiKiran9, your changes look good, thanks! ~Last question: Could you update this PR so that there are no conflicts and so everything is in order?~
Updated the PR for you!
Thankyou @kearfy
Hey @MSaiKiran9 Thank you for contributing to SurrealDB during Hacktoberfest 2023 🎉 Kindly send an email to community@surrealdb.com to coordinate the delivery of your SurrealDB swag! 😁
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 !