From 17997c2ea46bfa2fab118e0fdf078a104dcf1d91 Mon Sep 17 00:00:00 2001 From: Chenwei Xiao Date: Wed, 27 Oct 2021 01:30:11 +0800 Subject: [PATCH] doc: add default value for offset for computed (#3161) --- docs/react-integration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/react-integration.md b/docs/react-integration.md index 129e8e1f9..66ca290c6 100644 --- a/docs/react-integration.md +++ b/docs/react-integration.md @@ -421,7 +421,7 @@ However, the set of props that a React component receives is in itself not obser import { observer, useLocalObservable } from "mobx-react-lite" import { useEffect } from "react" -const TimerView = observer(({ offset }) => { +const TimerView = observer(({ offset = 0 }) => { const timer = useLocalObservable(() => ({ offset, // The initial offset value secondsPassed: 0,