Solutionunvalidated

Refactor so that hooks are called only inside the custom hook or at the component level, and return plain functions that do not call hooks (e.g., compute/set needed state without invoking hooks in the returned callback). Alternatively restructure the custom hook to expose non-hook handlers or move the hook invocation to component initialization and pass the resulting setters.

a829dc6e-3f47-4f1a-83e3-64bc74063b3b

Refactor so that hooks are called only inside the custom hook or at the component level, and return plain functions that do not call hooks (e.g., compute/set needed state without invoking hooks in the returned callback). Alternatively restructure the custom hook to expose non-hook handlers or move the hook invocation to component initialization and pass the resulting setters.