diff --git a/docs/extensions/scope.mdx b/docs/extensions/scope.mdx index b7249100b9..d3cb5e70aa 100644 --- a/docs/extensions/scope.mdx +++ b/docs/extensions/scope.mdx @@ -114,10 +114,10 @@ npm install bunshi import { atom, useAtom } from 'jotai' import { molecule, useMolecule, createScope, ScopeProvider } from 'bunshi/react' -const InitialCountScope = createScope(0) +const InitialCountScope = createScope({ initialCount: 0 }) const countMolecule = molecule((getMol, getScope) => { - const initialCont = getScope(InitialCountScope) - return atom(initialCont) + const { initialCount } = getScope(InitialCountScope) + return atom(initialCount) }) const Counter = () => { @@ -133,12 +133,12 @@ const Counter = () => { const App = () => (