Skip to content

Commit

Permalink
fix(docs): Update usage without React on recipes.mdx (#2047)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
ivanquirino and sewera authored Sep 14, 2023
1 parent f3a0fd8 commit deba6ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/recipes/recipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

1 comment on commit deba6ed

@vercel
Copy link

@vercel vercel bot commented on deba6ed Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.