From 0c408b288fc0eea88daa45a13c4549ac5ed1b7c9 Mon Sep 17 00:00:00 2001 From: JongChan Choi Date: Wed, 15 Jan 2025 17:48:18 +0700 Subject: [PATCH] docs: fix bunshi example --- docs/extensions/scope.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/extensions/scope.mdx b/docs/extensions/scope.mdx index b7249100b99..0d14774cee4 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 = () => (

With initial value 1

- +

With initial value 2

- +