It's been a while since I wrote my last article on state management in React using Context. Here's the link for anyone who wants to give it a read....
For further actions, you may consider blocking this person and/or reporting abuse
Excellent work. 🌟
Only thing I would do differently is to create a resuable function for storing your form state.
You use the following pattern:
Which could be upgraded to:
Amazing!
Glad you liked it!
Thank you for making this tutorial. This is almost exactly what I needed, but I used NextAuth.js to create the authentication table.
So did you connect nextauth with the supabase postgres instance
I did. Several things I had to do different.
Instead of
.env.local
, I had to add the supabase environment variables tonext.config.js
because the client supabase is declared client side instead of server side.With nextauth I had to do an async call getSession() to request the userId first before querying because the userId isn't exposed to the default session object for security reasons
This was also my first time using Typescript so there were all kinds of issues trying to follow the code to get it working on my own project.
That's awesome.
I am a simple man, I see React-Query, I press "LOVE"
Haha
Really useful article, Ankit! Keep up the good work
Thanks Aquib
This is excellent thank you
This pattern continues to replace 99% of my state boilerplate. Thanks again Ankit, really
Thank you for this <3