From cb01f78e4435858477608b6f8501eb8dd9aa5b45 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 27 Mar 2018 16:22:20 -0700 Subject: [PATCH] Small copy tweaks (#718) --- content/blog/2018-03-27-update-on-async-rendering.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/blog/2018-03-27-update-on-async-rendering.md b/content/blog/2018-03-27-update-on-async-rendering.md index 1a3bf5f52..c743dd93d 100644 --- a/content/blog/2018-03-27-update-on-async-rendering.md +++ b/content/blog/2018-03-27-update-on-async-rendering.md @@ -119,7 +119,7 @@ Here is an example of a component that uses the legacy `componentWillReceiveProp Although the above code is not problematic in itself, the `componentWillReceiveProps` lifecycle is often mis-used in ways that _do_ present problems. Because of this, the method will be deprecated. -As of version 16.3, the recommended way to update `state` in response to `props` changes is with the new `static getDerivedStateFromProps` lifecycle. (That lifecycle is called when a component is created and each time it receives new props.): +As of version 16.3, the recommended way to update `state` in response to `props` changes is with the new `static getDerivedStateFromProps` lifecycle. (That lifecycle is called when a component is created and each time it receives new props): `embed:update-on-async-rendering/updating-state-from-props-after.js` > Note @@ -141,7 +141,7 @@ Either way, it is unsafe to use `componentWillUpdate` for this purpose in async Here is an example of a component that fetches external data based on `props` values: `embed:update-on-async-rendering/updating-external-data-when-props-change-before.js` -The recommended upgrade path for this component is to move data-updates into `componentDidUpdate`. You can also use the new `getDerivedStateFromProps` lifecycle to clear stale data before rendering the new props: +The recommended upgrade path for this component is to move data updates into `componentDidUpdate`. You can also use the new `getDerivedStateFromProps` lifecycle to clear stale data before rendering the new props: `embed:update-on-async-rendering/updating-external-data-when-props-change-after.js` > Note