#State managment
2 messages · Page 1 of 1 (latest)
Hey there.
I'd say you don't have to use one over the other. The two are really for different use cases. If you want simple, small, SSR safe and reactive state (something like a simple array of user notifications, or a cookie value), you can stick to useState.
But as soon as you start doing something like useMyState that derives values from your simple state (i.e. computed properties based on state), or that handles manipulating deeply nested state objects, that's when I'd go for Pinia which is really tailored for that sort of things.
Note that if you really don't want to use Pinia you can still use composables and make your own reactive state management using only useState but at this point you'd be reinventing the wheel that Pinia made for us 🙂