Skip to content
Myr

Update nextjs.md (#2998)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Update nextjs.md add mandatory argument for useRef * Update testing.md added initialValue for useRef

authored by Mohit Tokas · committed by GitHub · parent c96cf83 · Browse files · 2 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:docs/guides/nextjs.md+2 added-2 removed
122 unmodified lines
123124export const CounterStoreProvider = ({125 children,126}: CounterStoreProviderProps) => {127 const storeRef = useRef<CounterStoreApi>()127 const storeRef = useRef<CounterStoreApi>(null)128 if (!storeRef.current) {129 storeRef.current = createCounterStore()130 }131
84 unmodified lines
216217export const CounterStoreProvider = ({218 children,219}: CounterStoreProviderProps) => {220 const storeRef = useRef<CounterStoreApi>()220 const storeRef = useRef<CounterStoreApi>(null)221 if (!storeRef.current) {222 storeRef.current = createCounterStore(initCounterStore())223 }224
179 unmodified lines
modified:docs/guides/testing.md+1 added-1 removed
346 unmodified lines
347348export const CounterStoreProvider = ({349 children,350}: CounterStoreProviderProps) => {351 const counterStoreRef = useRef<CounterStoreApi>()351 const counterStoreRef = useRef<CounterStoreApi>(null)352 if (!counterStoreRef.current) {353 counterStoreRef.current = createCounterStore()354 }355
173 unmodified lines