Skip to content

Commit

Permalink
docs: extra clarification on why private state isn't allowed (#2507)
Browse files Browse the repository at this point in the history
* Some extra clarification on why private state isn't allowed

* Update packages/docs/core-concepts/index.md

---------

Co-authored-by: Eduardo San Martin Morote <[email protected]>
  • Loading branch information
gunhaxxor and posva authored Nov 28, 2023
1 parent 8f44ce9 commit 9adbd58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/docs/core-concepts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ In _Setup Stores_:
- `computed()`s become `getters`
- `function()`s become `actions`

Note you **must** return **all state properties** in setup stores for pinia to pick them up as state. In other words, you cannot have _private_ state properties in stores.
Note you **must** return **all state properties** in setup stores for pinia to pick them up as state. In other words, you cannot have _private_ state properties in stores. Not returning all state properties can break SSR, devtools, and other plugins.

Setup stores bring a lot more flexibility than [Option Stores](#option-stores) as you can create watchers within a store and freely use any [composable](https://vuejs.org/guide/reusability/composables.html#composables). However, keep in mind that using composables will get more complex when using [SSR](../cookbook/composables.md).

Expand Down

0 comments on commit 9adbd58

Please sign in to comment.