Closed ecumene closed 3 years ago
So I simply removed layoutWall. it was sort of redundant, calling a function that calls a single function.
const handleSubmit = (event) => { event.preventDefault(); setListOfMeasurements(makeAList(wallLength, onCenterSpacing, studOffset, isImperialUnit)); }
Either wrap layoutWall in a useCallback or just call
setListOfMeasurements(makeAList);
directly in your function.https://github.com/Hello-World-Software-Studios/calculator/blob/c4bec9890d695b722df2186732f6c1e14ee283cb/src/components/calculator.jsx#L32
https://stackoverflow.com/questions/58866796/understanding-the-react-hooks-exhaustive-deps-lint-rule