From deba6ed0d05b0dcb66c95177035ec8a061715745 Mon Sep 17 00:00:00 2001 From: Ivan Quirino Date: Wed, 13 Sep 2023 22:03:20 -0300 Subject: [PATCH] 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 * remove empty line on recipes.mdx --------- Co-authored-by: Blazej Sewera --- docs/recipes/recipes.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/recipes/recipes.mdx b/docs/recipes/recipes.mdx index 471e930f96..0bc8a32375 100644 --- a/docs/recipes/recipes.mdx +++ b/docs/recipes/recipes.mdx @@ -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)