Skip to main content

All Questions

Tagged with
0 votes
1 answer
21 views

useState returning empty array on default state, using react + supabase

I need help to understand why when I console.log(menus) on Menu.jsx it returns an array of values, but if I console.log(item) it only returns an empty array, while the default value of the item is &...
eko pram's user avatar
2 votes
2 answers
49 views

How to reset my useState to it's initial state after filtered list has rendered?

I am having trouble figuring out how to reset my projectList to it's initial state so that way in the filterProjects function it is filtering through the entire projectList and not the already ...
Amanda Morgan's user avatar
0 votes
0 answers
24 views

how to modify my useDocumentTitle hook to support and display Product {itemNo}

i do not know how to modify my useDocumentTitle hook to be able to use Product{itemNo} in the website when you choose a product and the page opens to it and all it's details are shown, on the browser ...
renad's user avatar
  • 1
0 votes
1 answer
31 views

React: when an element in an array gets deleted, all subsequent elements gets re-rendered, while the previous don't

In this project (React with NextJS), the user can see various statistics, statistics like how many orders a certain rider made, how many hours it worked and so on. The user is not limited to just one &...
Alessandro Cecchini's user avatar
0 votes
0 answers
17 views

Update state, object with arrays

I would like to know how I could update this state: details: {id:{optionA: optionA, optionB: optionB, quantity:1 }} It would be something like this: details: [{ 1: {optionA: optionA, optionB: optionB, ...
ISMILIRDS IO's user avatar
-1 votes
1 answer
65 views

How can I reset an array in a React state after a successful fetch request?

So, I'm collecting cellphone numbers from a textarea: the values are held in state. I will validate them and/or add a country prefix based on whether or not they already have the prefix. For each ...
deXtro's user avatar
  • 59
-1 votes
1 answer
51 views

useState set method not changing my state - react native

I'm working on a part of an application dealing with a deck of cards. For however many cards a player is supposed to have, I am looping through a deck of cards held in a state, randomly picking a card,...
jcboz's user avatar
  • 3
1 vote
1 answer
57 views

Cannot pass data from one page to another using useState on button click

I am running a function when the user clicks a button, this function updates my useState and adds an array into it as data. This data later on is passed into another webpage where the array objects ...
ang.jr57's user avatar
0 votes
2 answers
26 views

Timestamp array list covert hours minutes Seconds into setInterval time for each 1 seconds

Hi everyone facing one issue in my react application where I have array of list timestamp's ex:([1651234567, 1651234568, 1651234569]) which I need to convert in to hours minutes & seconds like Ex:(...
abhijit bakshi's user avatar
-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 ...
Oleg's user avatar
  • 41
1 vote
0 answers
65 views

explaining why React Hook useEffect has a missing dependency [duplicate]

I'm new to React, but why vs code is showing me this message in the problem tab isn't adding currentNoteId to the dependence array will crash the app const [notes, setNotes] = useState([]); const [...
Ahmad Maartmesrini's user avatar
0 votes
0 answers
42 views

dropdown is close when i click outside and whene i click in the <li> is not closed

This is my useEffect function for if i click outside of the liste it will be closed First when i click in the <li> the list is showed but when i click again in to <li> it doesn't closed ...
Soufiane Fathaoui's user avatar
0 votes
1 answer
73 views

Filter array by object value deletes the wrong object

I'm using react with context and I want to delete an object. Here's my code Context.js export const postsReducer = (state, action) => { switch (action.type) { case "SET_POSTS": ...
DC37's user avatar
  • 113
0 votes
0 answers
21 views

Email.js:247 Uncaught TypeError: Cannot read properties of undefined (reading 'id')

When ever I click on the particular data on the list the data is consoled only for the params. And it is not setting that data for selectedRow and also not consoling this part if (!selectedRow) { } ...
advaith's user avatar
0 votes
0 answers
20 views

Retrieving data to an array returns empty [duplicate]

I created a simple application using Node, React and Mongo. When I try to retrieve the data from Mongo, the array to which I'm trying to populate the data returns an empty array. Adding Data works ...
thegaffoor's user avatar

15 30 50 per page
1
2 3 4 5
59