From bdc60c26848820239db732b7218d41f4c2b204af Mon Sep 17 00:00:00 2001 From: Soichiro Miki Date: Thu, 14 Sep 2023 13:42:14 +0900 Subject: [PATCH 1/2] FIx typo: props => context (#6300) --- src/content/reference/react/Component.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/reference/react/Component.md b/src/content/reference/react/Component.md index 2d49972d75..6174cd753a 100644 --- a/src/content/reference/react/Component.md +++ b/src/content/reference/react/Component.md @@ -813,7 +813,7 @@ If you define `UNSAFE_componentWillReceiveProps`, React will call it when the co #### Parameters {/*unsafe_componentwillreceiveprops-parameters*/} - `nextProps`: The next props that the component is about to receive from its parent component. Compare `nextProps` to [`this.props`](#props) to determine what changed. -- `nextContext`: The next props that the component is about to receive from the closest provider. Compare `nextContext` to [`this.context`](#context) to determine what changed. Only available if you specify [`static contextType`](#static-contexttype) (modern) or [`static contextTypes`](#static-contexttypes) (legacy). +- `nextContext`: The next context that the component is about to receive from the closest provider. Compare `nextContext` to [`this.context`](#context) to determine what changed. Only available if you specify [`static contextType`](#static-contexttype) (modern) or [`static contextTypes`](#static-contexttypes) (legacy). #### Returns {/*unsafe_componentwillreceiveprops-returns*/} From a1673f583e2968b2458e37e7d414416dde638d1f Mon Sep 17 00:00:00 2001 From: Yucohny <79147654+Yucohny@users.noreply.github.com> Date: Fri, 15 Sep 2023 08:36:58 +0800 Subject: [PATCH 2/2] fix: resolve conflict --- src/content/reference/react/Component.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/content/reference/react/Component.md b/src/content/reference/react/Component.md index 04201acbb2..d241f243d7 100644 --- a/src/content/reference/react/Component.md +++ b/src/content/reference/react/Component.md @@ -812,13 +812,8 @@ class Rectangle extends Component { #### 参数 {/*unsafe_componentwillreceiveprops-parameters*/} -<<<<<<< HEAD -- `nextProps`:组件将从其父组件接收的下一个 props。将 `nextProps` 与 [`this.props`](#props) 进行比较以确定发生了什么变化。 -- `nextContext`:组件将从最近的提供者处接收的下一个 props。将 `nextContext` 与 [`this.context`](#context) 进行比较以确定发生了什么变化。仅当你指定 [`static contextType`](#static-contexttype)(更新的)或 [`static contextTypes`](#static-contexttypes)(旧版)时才可用。 -======= -- `nextProps`: The next props that the component is about to receive from its parent component. Compare `nextProps` to [`this.props`](#props) to determine what changed. -- `nextContext`: The next context that the component is about to receive from the closest provider. Compare `nextContext` to [`this.context`](#context) to determine what changed. Only available if you specify [`static contextType`](#static-contexttype) (modern) or [`static contextTypes`](#static-contexttypes) (legacy). ->>>>>>> bdc60c26848820239db732b7218d41f4c2b204af +- `nextProps`:组件即将从父组件接收的下一个 props。可以将 `nextProps` 与 [`this.props`](#props) 进行比较以确定具体是什么地方发生了变化。 +- `nextContext`:组件即将从最近的 provider 中接收的下一个 context。可以将 `nextContext` 与 [`this.context`](#context) 进行比较以确定具体是什么地方发生了变化。仅在指定 [`static contextType`](#static-contexttype))(最新用法)或 [`static contextTypes`](#static-contexttypes) 时可用(传统用法)。 #### 返回值 {/*unsafe_componentwillreceiveprops-returns*/}