Browse Source

Mention getSnapshotBeforeUpdate should return. (#930)

If getSnapshotBeforeUpdate does not return a snapshot value or null
it will cause a warning.  Document that it should return this value.
main
Stephen Lau 7 years ago
committed by Dan Abramov
parent
commit
61a8b62b03
  1. 2
      content/docs/reference-react-component.md

2
content/docs/reference-react-component.md

@ -297,6 +297,8 @@ Note that this method is fired on *every* render, regardless of the cause. This
This use case is not common, but it may occur in UIs like a chat thread that need to handle scroll position in a special way.
A snapshot value (or `null`) should be returned.
For example:
`embed:react-component-reference/get-snapshot-before-update.js`

Loading…
Cancel
Save