---
title: "Discussion on \"分享一下我的zustand错误使用案例\" | Hashnode"
description: "Discussion on \"分享一下我的zustand错误使用案例\". 什么是 zustand？\nzustand 是一个状态管理库，简单易用。\n在使用 react-scan 的时候，我发现我在 A 组件中对于 store 的某个 state 的更新，导致了 B 组件的重新渲染，有比较严重的性能问题。\n于是我又重新阅读了文档，发现我之前对于 zustand 的使用是错误的。\n错误用法 1 没有使用 single selector 或者 shallow 去获取 state\n这是之前的写法以及对应的组件，useGlobalStore 中有不只 uploadToServer..."
url: "https://hashnode.com/posts/zustand/67611beb629c6d443807d7b1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [分享一下我的zustand错误使用案例](https://kazoottt.hashnode.dev/zustand?utm_source=hashnode&utm_medium=feed)

什么是 zustand？ zustand 是一个状态管理库，简单易用。 在使用 react-scan 的时候，我发现我在 A 组件中对于 store 的某个 state 的更新，导致了 B 组件的重新渲染，有比较严重的性能问题。 于是我又重新阅读了文档，发现我之前对于 zustand 的使用是错误的。 错误用法 1 没有使用 single selector 或者 shallow 去获取 state 这是之前的写法以及对应的组件，useGlobalStore 中有不只 uploadToServer...

Dec 17, 2024 · 2 min read · kazoottt.hashnode.dev  
Updated Dec 18, 2024  
Read the article

-   [#zustand](https://hashnode.com/tag/zustand)
-   [#reactjs](https://hashnode.com/tag/reactjs)

## Written by

[KazooTTT](https://hashnode.com/@kazoottt)

@kazoottt

  
[View profile](https://hashnode.com/@kazoottt)

front-end developer, photography hobbyist, guitar, blender.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
