From 61a8b62b032da994a3cd02b4bb88c3299312b84e Mon Sep 17 00:00:00 2001 From: Stephen Lau Date: Fri, 22 Jun 2018 13:08:54 +0200 Subject: [PATCH] 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. --- content/docs/reference-react-component.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/docs/reference-react-component.md b/content/docs/reference-react-component.md index 88dafb35..26005e58 100644 --- a/content/docs/reference-react-component.md +++ b/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`