From 5c9f2adc182a534f4a7161209eb7e6d77d650e13 Mon Sep 17 00:00:00 2001 From: siddtheone <45398971+siddtheone@users.noreply.github.com> Date: Sun, 23 Feb 2025 16:54:50 +0530 Subject: [PATCH] Update queueing-a-series-of-state-updates.md ## Update React Docs: State Updater Function Example ### Summary This PR improves the clarity of the documentation regarding the use of state updater functions in React. The previous wording was slightly ambiguous, and this revision makes the explanation more precise. ### Changes - Updated the sentence: **Before:** "To update some state multiple times in one event, you can use `setNumber(n => n + 1)` updater function." **After:** "To update some state multiple times in one event, you can use an updater function like `setNumber(n => n + 1)`." ### Rationale - Introduces **"an updater function"** before the example for better readability. - Ensures consistency with React documentation standards. - Improves comprehension for new developers. --- src/content/learn/queueing-a-series-of-state-updates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/learn/queueing-a-series-of-state-updates.md b/src/content/learn/queueing-a-series-of-state-updates.md index 41de6529a6d..65301a32886 100644 --- a/src/content/learn/queueing-a-series-of-state-updates.md +++ b/src/content/learn/queueing-a-series-of-state-updates.md @@ -264,7 +264,7 @@ If you prefer more verbose code, another common convention is to repeat the full * Setting state does not change the variable in the existing render, but it requests a new render. * React processes state updates after event handlers have finished running. This is called batching. -* To update some state multiple times in one event, you can use `setNumber(n => n + 1)` updater function. +* To update some state multiple times in one event, you can use an updater function like `setNumber(n => n + 1)`. @@ -600,4 +600,4 @@ Now you know how this part of React works! - \ No newline at end of file +