Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary state wrapper #52

Open
tonylomax opened this issue Jul 6, 2023 · 0 comments
Open

Unnecessary state wrapper #52

tonylomax opened this issue Jul 6, 2023 · 0 comments
Labels

Comments

@tonylomax
Copy link
Collaborator

https://github.com/fac27/mood-map/blob/3b09f874eae09d469f58502904362280119ddd11/src/app/life-in-colour/page.tsx#L11C1-L12C45

Imo you don't really need these wrapper function as they add noise and are just doing what the state update functions are doing anyways, you could just set state inline.

onClick={openModal} -> onClick={() => setIsOpen(true)}

If you were feeling fancy you could do something like this:

const toggleModal = () => {
    setIsOpen(!isOpen)
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants