Repository navigation
Commit b57db4f
docs(create): document that state cannot be read during initialization (#3569)
* docs(create): document that state cannot be read during initialization
The store api passed to the state creator function is not usable for reading
state while that function runs: get() and store.getState() return undefined,
and store.getInitialState() throws "Cannot access 'initialState' before
initialization". Per the discussion, this is a designed limitation rather than
a bug, so document it in the create and createStore troubleshooting sections.
Ref: #3529
* docs(create): shorten init-time state access note to a one-line caveat
Per review feedback, the troubleshooting section was too long for such a subtle
behavior. Replace it with a one-line note on the stateCreatorFn parameter in
both create and createStore.
---------
Co-authored-by: fandi <[email protected]>1 parent f094eeb commit b57db4f
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
0 commit comments