From b44e18e015c654c5db7597ac7eadc96e5ecd94b0 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 16 Nov 2022 09:27:02 +0000 Subject: [PATCH] Add note about getSnapshotBeforeUpdate --- beta/src/content/apis/react/Component.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/beta/src/content/apis/react/Component.md b/beta/src/content/apis/react/Component.md index a5d9ac37..6a45e116 100644 --- a/beta/src/content/apis/react/Component.md +++ b/beta/src/content/apis/react/Component.md @@ -1446,6 +1446,12 @@ You should return a snapshot value of any type that you'd like, or `null`. The v - `getSnapshotBeforeUpdate` will not get called if [`shouldComponentUpdate`](#shouldcomponentupdate) is defined and returns `false`. + + +At the moment, there is no equivalent to `getSnapshotBeforeUpdate` for function components. This use case is very uncommon, but if you have the need for it, for now you'll have to write a class component. + + + --- ### `render()` {/*render*/}