T
TanStack•2y ago
extended-salmon

Best Practices for Handling Shopping Cart Data Storage in React with Local Storage and Database.

Hey everyone, I'm in the process of creating a shopping cart feature with React, React Router DOM v6, and React Query. The cart functionality is up and running smoothly. However, I'm looking for guidance on the optimal method for handling cart data storage. Initially, I'd like to allow non-authenticated users to store their cart information locally (local storage). Then, once a user is authenticated, I'd like to transition the cart data storage to a database. Any suggestions or best practices for implementing this transition would be greatly appreciated! Thanks in advance for your insights!
2 Replies
extended-salmon
extended-salmonOP•2y ago
@TkDodo 🔮
extended-salmon
extended-salmon•2y ago
question doesn't seem to be intended to react to react query. more like a cart system implementation architecture question

Did you find this page helpful?