Skip to content

Commit c57a17f

Browse files
committed
docs: note about state in setup stores
See #2324
1 parent b560467 commit c57a17f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: packages/docs/core-concepts/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ In _Setup Stores_:
6868
- `computed()`s become `getters`
6969
- `function()`s become `actions`
7070

71+
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.
72+
7173
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).
7274

7375
Setup stores are also able to rely on globally _provided_ properties like the Router or the Route. Any property [provided at the App level](https://vuejs.org/api/application.html#app-provide) can be accessed from the store using `inject()`, just like in components:

0 commit comments

Comments
 (0)