cascadingSetState{{count}} setState calls in a single useEffect — consider using useReducer or deriving statesmall-rules/no-cascading-set-stateDisallow effect hooks with many cascading state updates.
cascadingSetState{{count}} setState calls in a single useEffect — consider using useReducer or deriving stateThis rule does not accept options.
import { useEffect, useState } from "@rbxts/react";
function Component() { const [firstValue, setFirstValue] = useState(0); const [secondValue, setSecondValue] = useState(0); const [thirdValue, setThirdValue] = useState(0);
useEffect(() => { setFirstValue(firstValue + 1); setSecondValue(secondValue + 1); setThirdValue(thirdValue + 1); }, [firstValue, secondValue, thirdValue]);}import { useEffect, useState } from "@rbxts/react";
function Component() { const [firstValue, setFirstValue] = useState(0); const [secondValue, setSecondValue] = useState(0);
useEffect(() => { setFirstValue(firstValue + 1); setSecondValue(secondValue + 1); }, [firstValue, secondValue]);}