Skip to content

How to use a get function from the store, if the component doesn't rerender #774

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

You must be logged in to vote

would you consider something like this to be best practice:

const productCount = useStore((state) => state.products.length)

Yes!

Replies: 1 comment 3 replies

Comment options

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

@dai-shi
Comment options

@domvo
Comment options

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