-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,17 @@ This package was originally inspired by [`createContext`](https://github.com/pmn | |
- Uses modern typescript features to simplify the code and reduce bundle size. | ||
- Returns an array of the Provider and `useStore` hook to reduce bundle size and improve DX. | ||
|
||
### Peer Dependencies | ||
For a detailed explanation, check out TkDoDo's [blog post](https://tkdodo.eu/blog/zustand-and-react-context). | ||
|
||
### Why is this useful? | ||
|
||
- **Dependency Injection**: You can pass in props to the store creator. | ||
- This is useful for testing and [initializing the store with props](https://github.com/pmndrs/zustand/blob/main/docs/guides/initialize-state-with-props.md). | ||
- You can also use this to create multiple instances of the same store with different props. | ||
- **Type Safety**: You can define the store type and use it in the `useStore` hook. | ||
- **Simplified API**: The API is simplified and easier to use than the original `zustand/context`. | ||
|
||
## Peer Dependencies | ||
|
||
For `[email protected]` and higher | ||
|
||
|