diff --git a/packages/compose/README.md b/packages/compose/README.md index f72dfb4ce9e810..1a46e8fb19bf48 100644 --- a/packages/compose/README.md +++ b/packages/compose/README.md @@ -367,7 +367,7 @@ _Parameters_ _Returns_ -- `T|undefined`: The value from the previous render. +- `T | undefined`: The value from the previous render. # **useReducedMotion** diff --git a/packages/compose/src/hooks/use-previous/index.js b/packages/compose/src/hooks/use-previous/index.js index 035a272b06953c..c50e392a43226a 100644 --- a/packages/compose/src/hooks/use-previous/index.js +++ b/packages/compose/src/hooks/use-previous/index.js @@ -11,14 +11,14 @@ import { useEffect, useRef } from '@wordpress/element'; * * @param {T} value The value to track. * - * @return {T|undefined} The value from the previous render. + * @return {T | undefined} The value from the previous render. */ export default function usePrevious( value ) { // Disable reason: without an explicit type detail, the type of ref will be // inferred based on the initial useRef argument, which is undefined. // https://github.com/WordPress/gutenberg/pull/22597#issuecomment-633588366 /* eslint-disable jsdoc/no-undefined-types */ - const ref = useRef( /** @type {T|undefined} */ ( undefined ) ); + const ref = useRef( /** @type {T | undefined} */ ( undefined ) ); /* eslint-enable jsdoc/no-undefined-types */ // Store current value in ref. diff --git a/packages/compose/tsconfig.json b/packages/compose/tsconfig.json index 9544096d8ff048..0b134e049ff11a 100644 --- a/packages/compose/tsconfig.json +++ b/packages/compose/tsconfig.json @@ -19,6 +19,7 @@ "src/hooks/use-debounce/**/*", "src/hooks/use-instance-id/**/*", "src/hooks/use-focus-return/**/*", + "src/hooks/use-previous/**/*", "src/utils/**/*" ] }