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

React+Node starter #42

Merged
merged 3 commits into from Oct 20, 2023
Merged

React+Node starter #42

merged 3 commits into from Oct 20, 2023

Conversation

MSaiKiran9
Copy link
Contributor

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 !

@kearfy
Copy link
Member

kearfy commented Oct 13, 2023

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 😃

@MSaiKiran9
Copy link
Contributor Author

@kearfy Thanks for letting me know I'm on it !

@MSaiKiran9
Copy link
Contributor Author

MSaiKiran9 commented Oct 13, 2023

@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

@naisofly naisofly requested a review from Ekwuno October 17, 2023 14:08
@MSaiKiran9
Copy link
Contributor Author

Hi @Ekwuno @kearfy can you confirm if this is okay

@kearfy
Copy link
Member

kearfy commented Oct 20, 2023

Hey @MSaiKiran9, your email got buried in my inbox, apologies! Will have a look tonight

@kearfy
Copy link
Member

kearfy commented Oct 20, 2023

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!

@kearfy kearfy merged commit ab25b36 into surrealdb:main Oct 20, 2023
1 check passed
@MSaiKiran9
Copy link
Contributor Author

Thankyou @kearfy

@naisofly naisofly added the hacktoberfest-accepted Thanks for your contribution! label Oct 23, 2023
@naisofly
Copy link
Contributor

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! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Thanks for your contribution!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants