Should hook useToggle ignore React events? #696
|
Hi all, function MyComponent() {
const [state, toggleState] = useToggle(false);
return <button onClick={toggleState}>Toggle me!<button>
}I'm wondering if we can ignore the first argument if it is an event (or a click event in this case). |
Answered by
AndreasNel
Nov 16, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there!
This functionality was introduced in #867 and released in version 15.0.0.