Skip to content

Commit

Permalink
Update nextjs.md
Browse files Browse the repository at this point in the history
add mandatory argument for useRef
  • Loading branch information
theperfectpunk authored Feb 5, 2025
1 parent 7df4874 commit 45286fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guides/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export interface CounterStoreProviderProps {
export const CounterStoreProvider = ({
children,
}: CounterStoreProviderProps) => {
const storeRef = useRef<CounterStoreApi>()
const storeRef = useRef<CounterStoreApi>(null)
if (!storeRef.current) {
storeRef.current = createCounterStore()
}
Expand Down Expand Up @@ -217,7 +217,7 @@ export interface CounterStoreProviderProps {
export const CounterStoreProvider = ({
children,
}: CounterStoreProviderProps) => {
const storeRef = useRef<CounterStoreApi>()
const storeRef = useRef<CounterStoreApi>(null)
if (!storeRef.current) {
storeRef.current = createCounterStore(initCounterStore())
}
Expand Down

0 comments on commit 45286fc

Please sign in to comment.