Skip to content

Commit

Permalink
doc: add default value for offset for computed (#3161)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinzid authored Oct 26, 2021
1 parent 4946820 commit 17997c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/react-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 17997c2

Please sign in to comment.