Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/usage/nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default function StoreProvider({
children: React.ReactNode
}) {
// highlight-start
const storeRef = useRef<AppStore>()
const storeRef = useRef<AppStore | null>(null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const storeRef = useRef<AppStore | null>(null)
const storeRef = useRef<AppStore>(null)

if (!storeRef.current) {
// Create the store instance the first time this renders
storeRef.current = makeStore()
Expand Down