From 5a3de3e9d837acae03eaa0dc3c6a02dfd1f76d99 Mon Sep 17 00:00:00 2001 From: Vipul Gupta Date: Sat, 15 Jun 2024 00:19:38 +0530 Subject: [PATCH 1/2] docs: Update the links. --- packages/compose/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compose/README.md b/packages/compose/README.md index f4f0631ba36a51..c4366ce1c771ab 100644 --- a/packages/compose/README.md +++ b/packages/compose/README.md @@ -1,6 +1,6 @@ # Compose -The `compose` package is a collection of handy [Hooks](https://reactjs.org/docs/hooks-intro.html) and [Higher Order Components](https://facebook.github.io/react/docs/higher-order-components.html) (HOCs) you can use to wrap your WordPress components and provide some basic features like: state, instance id, pure... +The `compose` package is a collection of handy [Hooks](https://react.dev/reference/react-dom/hooks) and [Higher Order Components](https://legacy.reactjs.org/docs/higher-order-components.html) (HOCs) you can use to wrap your WordPress components and provide some basic features like: state, instance id, pure... The `compose` function is inspired by [flowRight](https://lodash.com/docs/#flowRight) from Lodash and works the same way. It comes from functional programming, and allows you to compose any number of functions. You might also think of this as layering functions; `compose` will execute the last function first, then sequentially move back through the previous functions passing the result of each function upward. From c8a470fae503b55b51ea86078a484d50f22974f7 Mon Sep 17 00:00:00 2001 From: Vipul Gupta Date: Mon, 17 Jun 2024 13:40:32 +0530 Subject: [PATCH 2/2] docs: Updates hooks reference link. --- docs/contributors/code/coding-guidelines.md | 2 +- packages/compose/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contributors/code/coding-guidelines.md b/docs/contributors/code/coding-guidelines.md index d89df5876e3804..a44f01df9413c7 100644 --- a/docs/contributors/code/coding-guidelines.md +++ b/docs/contributors/code/coding-guidelines.md @@ -758,7 +758,7 @@ When documenting an example, use the markdown \`\`\` code block to ### Documenting React components -When possible, all components should be implemented as [function components](https://reactjs.org/docs/components-and-props.html#function-and-class-components), using [hooks](https://reactjs.org/docs/hooks-intro.html) for managing component lifecycle and state. +When possible, all components should be implemented as [function components](https://reactjs.org/docs/components-and-props.html#function-and-class-components), using [hooks](https://react.dev/reference/react/hooks) for managing component lifecycle and state. Documenting a function component should be treated the same as any other function. The primary caveat in documenting a component is being aware that the function typically accepts only a single argument (the "props"), which may include many property members. Use the [dot syntax for parameter properties](https://jsdoc.app/tags-param.html#parameters-with-properties) to document individual prop types. diff --git a/packages/compose/README.md b/packages/compose/README.md index c4366ce1c771ab..62eaad1800a6a8 100644 --- a/packages/compose/README.md +++ b/packages/compose/README.md @@ -1,6 +1,6 @@ # Compose -The `compose` package is a collection of handy [Hooks](https://react.dev/reference/react-dom/hooks) and [Higher Order Components](https://legacy.reactjs.org/docs/higher-order-components.html) (HOCs) you can use to wrap your WordPress components and provide some basic features like: state, instance id, pure... +The `compose` package is a collection of handy [Hooks](https://react.dev/reference/react/hooks) and [Higher Order Components](https://legacy.reactjs.org/docs/higher-order-components.html) (HOCs) you can use to wrap your WordPress components and provide some basic features like: state, instance id, pure... The `compose` function is inspired by [flowRight](https://lodash.com/docs/#flowRight) from Lodash and works the same way. It comes from functional programming, and allows you to compose any number of functions. You might also think of this as layering functions; `compose` will execute the last function first, then sequentially move back through the previous functions passing the result of each function upward.