Skip to content

Commit

Permalink
put variable change inside useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
binsmyth committed Jun 17, 2024
1 parent 5e1152b commit 132eda3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ describe('usePagination', () => {
const renderHook = (useHook) => {
const result = {};
function TestCase() {
result.current = useHook();
const hookResult = useHook();
React.useEffect(() => {
result.current = hookResult;
}, [hookResult]);
return null;
}
render(<TestCase />);
Expand Down

0 comments on commit 132eda3

Please sign in to comment.