From d4e58aacf08b8eb846f1587f305a41556d699754 Mon Sep 17 00:00:00 2001 From: "C. T. Lin" Date: Mon, 28 Aug 2023 15:33:35 +0800 Subject: [PATCH] [Docs] `hook-use-state`: fix an undefined variable --- CHANGELOG.md | 2 ++ docs/rules/hook-use-state.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c21e803d8..1d4d736039 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange * [Docs] [`jsx-key`]: fix correct example ([#3656][] @developer-bandi) * [Tests] `jsx-wrap-multilines`: passing tests ([#3545][] @burtek) * [Docs] [`iframe-missing-sandbox`]: fix link to iframe attribute on mdn ([#3690][] @nnmrts) +* [Docs] [`hook-use-state`]: fix an undefined variable ([#3626][] @chentsulin) [#3690]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3690 [#3680]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3680 @@ -54,6 +55,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange [#3634]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3634 [#3633]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3633 [#3630]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3630 +[#3626]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3626 [#3623]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3623 [#3615]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3615 [#3545]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3545 diff --git a/docs/rules/hook-use-state.md b/docs/rules/hook-use-state.md index 838d86b607..9654f270fb 100644 --- a/docs/rules/hook-use-state.md +++ b/docs/rules/hook-use-state.md @@ -27,7 +27,7 @@ export default function useColor() { // useState call is destructured into value + setter pair, but identifier // names do not follow the [thing, setThing] naming convention const [color, updateColor] = React.useState(); - return useStateResult; + return [color, updateColor]; } ```