fix(docs): Update usage without React on recipes.mdx (#2047)

* Update usage without React on recipes.mdx

Makes recipes.mdx usage without React inline with the readme.md description, because the current recipes.mdx usage is deprecated

* Update docs/recipes/recipes.mdx

Change copy

Co-authored-by: Blazej Sewera <code@sewera.dev>

* remove empty line on recipes.mdx

---------

Co-authored-by: Blazej Sewera <code@sewera.dev>
This commit is contained in:
Ivan Quirino 2023-09-13 22:03:20 -03:00 committed by GitHub
parent f3a0fd802b
commit deba6ed0d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,13 +183,13 @@ const store = createStore(() => ({ ... }))
const { getState, setState, subscribe, destroy } = store
```
You can even consume an existing vanilla store with React:
You can use a vanilla store in React with a `useStore` hook.
```jsx
import { create } from 'zustand'
import { useStore } from 'zustand'
import { vanillaStore } from './vanillaStore'
const useStore = create(vanillaStore)
const useBoundStore = (selector) => useStore(vanillaStore, selector)
```
## Transient updates (for frequent state changes)