Skip to content

Commit 61a8b62

Browse files
Stephen Laugaearon
authored andcommitted
Mention getSnapshotBeforeUpdate should return. (reactjs#930)
If getSnapshotBeforeUpdate does not return a snapshot value or null it will cause a warning. Document that it should return this value.
1 parent 24f0448 commit 61a8b62

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

content/docs/reference-react-component.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ Note that this method is fired on *every* render, regardless of the cause. This
297297

298298
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.
299299

300+
A snapshot value (or `null`) should be returned.
301+
300302
For example:
301303

302304
`embed:react-component-reference/get-snapshot-before-update.js`

0 commit comments

Comments
 (0)