Questions tagged [zustand]

For questions regarding Zustand, a hook-based state management system for React.

A small, fast and scalable bearbones state-management solution using simplified flux principles. Has a comfy API based on hooks, isn't boilerplatey or opinionated.

231 questions
0
votes
1 answer

Change javascript arrow function into typesctipt

Grettings. So I am trying typescript. the initial code which I based on is on javascript const PokemonTable = () => { const pokemon = useStore((state) => state.pokemon); const filter = useStore((state) => state.filter); return (
Karol
  • 166
  • 1
  • 4
  • 15
0
votes
0 answers

Why i always need to return some html with Zustand(React-Redux state management tool) Store?

Why the "inc" button doesn't work, but the other ones are working? Am I missing something or is this the way that Zustand Store is supposed to work? the page I'm trying to render import React from "react"; // import store from "./store"; import {…
radurbalau
  • 99
  • 1
  • 9
0
votes
2 answers

How to set object key in state using zustand

I am using zustand for state management. My store is setup as follow : import create from 'zustand'; export const useStore = create((set) => ({ filters: {searchQuery: 'hello', evaluationMonth : null}, setFilters: (e) => set((state) =>…
Kevin.a
  • 4,094
  • 8
  • 46
  • 82
0
votes
0 answers

How Can I Update the property of an object based on another one updated at the same time - zustand?

I have a product and i want to get the total price of this product based on quantity, I'm using zustand for state management. here's a function I used to update the state. export const useCartProduct = create( devtools( …
Oliver D
  • 2,579
  • 6
  • 37
  • 80
0
votes
0 answers

Axios returning promise not destructed data in react with zustand

I'm currently trying to get axios running in a react hooks app. The basic get request is working fine and delivering the expected results, but here comes the problem: I'm using 'zustand' for application state management and established a central…
dorndalf
  • 21
  • 3
-1
votes
0 answers

Wait for zustand state update before executing next lines

I have a form where onSubmit Handler needs to call 4 different apis. In event of an error in any api, apis called before the faulty api should not be called when user resubmits the form after correction. I tried to store the result in zustand store…
1 2 3
15
16