All Questions
Tagged with state javascript
2,649
questions
0
votes
1
answer
25
views
Jotai useEffect Maximum update depth exceeded
I'm having an issue with a React native app where i store state in Jotai atoms.
My issue lies in my component that updates auth state on app state change.
When the app goes from inactive -> active, ...
0
votes
0
answers
15
views
Tri-State Checkbox, Checkbox with triple status? [duplicate]
I have a problem... I don't know much about HTML, CSS or Javascript and I'm practicing to know more and I set as a challenge to make a kind of book like the one of phasmophobia that has in the ...
0
votes
1
answer
53
views
re-render input component not losing focus when re-rendering
I present two different ways to render an input component;
E.g.1
function myComponent(){
const [st, setSt] = useState('');
return <...
0
votes
0
answers
59
views
State is reverting back even after i confirmed its change
so when i click evalute this expression '3+5*6-2/4' then result state is set to 32.5
after that clear function is being triggered and it sets the state to '' and after that when i press 5 it reverts ...
0
votes
1
answer
27
views
How to make sure state updates that are fired off in succession all execute
If I have multiple state updates that all fire off in rapid succession, the initial state updates will not fully update because they will be overridden by later state updates. How can I make it so ...
0
votes
1
answer
34
views
how to keep constant variable on react rendering
i've got stuck in react problems.
I've create an online shop (front-end) website in react
const products = [
{ id: 1, name: "Oppo", price: 200, unit: 1, img: "oppo.jpg" },
{ id:...
0
votes
1
answer
34
views
I cannot update state, because DND kit in react
I have an issue using the deleteProyect function, when the client clicks the button, the component does not eliminate the object in the array unless yo click as fast as you can, so it could be ...
0
votes
0
answers
14
views
Updating persisted zustand functions breaks app when deploying
Some background:
I'm building a new feature in a rather larger app. This feature should work across different pages so a state management solution is warranted. To handle such management, I've used ...
0
votes
1
answer
46
views
React State not saving at all
In the auth and login function, the data returned is correct, but when I save it to state, it just disappears
export const useAuth = () => {
const [user, setUser] = useState(null);
return {
...
1
vote
1
answer
41
views
React state variable throws error when updated using ++ prefix
I'm Fairly new to React and JS, just exploring the nitty-gritties of the lang.
I'm trying to compare the difference in updating the state variable "counter", using the ++ operator( and by ...
0
votes
0
answers
33
views
Solid JS Trouble Passing Information from Child to Child
I've created a card component that has its background image set from its parent component. These cards act as buttons to open modals with more details and share an image. I don't want the modal ...
0
votes
0
answers
16
views
Table row flickering after useReducer update
I have a table with data, that can be edited. The edition process triggers a modification in the table with useReducer.
The problem is the styling. The table rows have a hover effect but useReducer ...
0
votes
1
answer
47
views
React useState not automatically re-rendering to reflect an updated object in my database [duplicate]
I'm working on my first React project where I'm implementing a shopping cart feature. When a user clicks on a button to increase the quantity of an item in their cart, I update the quantity in the ...
1
vote
1
answer
972
views
Different setState behaviour in React 17 vs React 18
I was bug fixing the FE code for my company's App which still uses React 17, and I notice different behaviour when setting the state between React 17 and React 18 (without strict mode)
Code:
import ...
1
vote
2
answers
54
views
Filtering out a key from a useState is causing the last element of ref object to null
I have a visuals state that contains a list of JSX visuals, and their corresponding references stored in a useRef object. I key into both of these with a ref "counter". Currently in the ...