Skip to content

Any drawback of using a custom hook for useAtom? #2718

Answered by dai-shi
ArthurGuez asked this question in Q&A
Discussion options

You must be logged in to vote

Creating custom hooks is totally fine.

For the performance, using useSetAtom is better. const { setInfo } = useInfo() can cause extra rerenders.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ArthurGuez
Comment options

@dai-shi
Comment options

@DavidJFelix
Comment options

Answer selected by ArthurGuez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants