Skip to content

Question: Performance Optimization in Zustand #2974

Answered by dbritto-dev
dev2xl asked this question in Q&A
Discussion options

You must be logged in to vote

@dev2xl option 1 > option 2, option 1 you don't need to import anything and does not need to use a shallow comparison

Note

that's true only for primitive data types for complex data types you might need useShallow, let's say you are comparing Maps or Sets then you need to use useShallow

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dai-shi
Comment options

@dbritto-dev
Comment options

@dai-shi
Comment options

Answer selected by dev2xl
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