All Questions
Tagged with react-hooks redux
1,088
questions
-4
votes
0
answers
21
views
Invariant failed: A state mutation was detected between dispatches [closed]
This is the body of the code
const tableHeader = [
{ title: "Product name", widthClass: "w-[25%]" },
{ title: "Product category", widthClass: "w-[19%...
-1
votes
0
answers
21
views
Redux State Does Not Change When Modified From useInterval
so im trying to load user data from localStorage and set it to the redux user state. heres what i have done:
Where The User Is Being Used:
import Fruit from "../components/Fruit"
import { ...
0
votes
1
answer
44
views
Why is my `amount` reading as undefined from my `createSlice`?
I have just started learning Redux with React so I apologize if it is something as simple as syntax. This project prompts me to use a variety of react-redux functions.
I have my slice below:
/** @type ...
1
vote
2
answers
48
views
How is my useDispatch hook set up incorrectly here?
I have just started learning Redux with React so I apologize if it is something as simple as syntax. This project prompts me to use a variety of react-redux functions.
I have my slice below:
/** @type ...
0
votes
0
answers
53
views
React useCallback not working as expected in chatapp
Am making a chat app. Am using socket.io, redux-toolkit and rtk-query . When I open a chat I get chatId in params. and I sent the message (new message using socket.io) with the id.
The problem I'm ...
1
vote
1
answer
26
views
Search Reducer, searched items removed from redux store
import { createSlice } from "@reduxjs/toolkit";
export const productSlice = createSlice({
name: 'products',
initialState: [],
reducers: {
addProduct: (state, action) => {
...
1
vote
1
answer
129
views
In React/Next.js after click link data will not updated
In Next.js when clicking Link the new page url will open "/component/product", but according to product data will not updated in redux store where I used. It have to refresh page to update ...
1
vote
2
answers
57
views
Making it safe to call a hook from outside of the Redux Provider, when it access the Redux store?
I have a hook useGetFooId that attempts to get a Foo ID from the Redux store with fallback logic:
If the Foo ID is set in the Redux store, it returns the ID from there (but it's expected that in some ...
-1
votes
2
answers
41
views
How can I implement the inputSearch component so that users can find a certain task by typing a couple of letters? [duplicate]
For now, I have almost finished implementing the functionality for users to find a certain task. I am using a variable called isTaskListEmpty to render different content depending on its state. But ...
2
votes
4
answers
137
views
Too many re renders - React - Filter Data
const MyComponent = () => {
const [avaliador, setAvaliador] = useState("");
const [avaliadoresList, setAvaliadoresList] = useState([]);
const [DataResultsTotal, setDataResultsTotal] ...
1
vote
1
answer
42
views
how to get updated state inside useIdleTimer.onIdle callback?
Have this pretty simple logic where if there is a logged in user and he has been idle for a certain amount of time he should be shown an inactivity modal
const { user } = useTypedSelector((state) =>...
1
vote
1
answer
140
views
How can i filter values from the data coming from api call in react-redux
I am using react and redux to fetch data from an API call and now I have created a new variable and assigned it the same data. In the code, I am going to manipulate this new variable called ...
0
votes
1
answer
45
views
React Redux Issue: Modal Opens with Empty Data Instead of Existing Record for Editing
I’m working on a React project with Redux for state management. I’m encountering an issue where, when I try to edit an existing record, the modal supposed to open with the filled data is opening with ...
0
votes
1
answer
33
views
Looses focus after write one word in input when use UseSelctor. why?
Here is parent and child. i use UseSelector to get state and pass it child component. But when i write something in input it looses the focus. why?
enter image description here
enter image description ...
-1
votes
1
answer
93
views
React Hook "useSelector" used in common functions throws an error
This is my selectors.js
import { useSelector } from 'react-redux';
export const useCloseAlertTrigger = () => useSelector((state) => state.common.closeAlertTrigger || {});
this is my ...