@rific/auto-paper 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -201,6 +201,8 @@ dispatch(themeActions.setColor('#e91e63'))
|
|
|
201
201
|
dispatch(themeActions.setAppearance('dark'))
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
+
Dispatching `themeActions` from anywhere in the app reaches the Provider because `initialValue` is live after mount: the Provider adopts any value that changes. That needs @rific/core 0.3.0 or later. With @rific/core 0.2.1 or older, `initialValue` is only read at mount, so write through the Provider's own setters instead.
|
|
205
|
+
|
|
204
206
|
The `App.tsx` example above hand-builds the `initialValue`/`onReady` prop pair inline. Once you also need `onChange` wired back to `dispatch`, reach for `useThemeBridgeProps` instead of re-deriving that same three-field object by hand: it takes your already-resolved `settings`/`onChange`/`onReady` and reshapes them into the exact, memoized prop bag `Provider` expects.
|
|
205
207
|
|
|
206
208
|
```tsx
|