Skip to main content

All Questions

1 vote
1 answer
79 views

I have tried to implement search functionality in react, when I clear the input, I am not getting back the full list

The search functionality works but when I clear the input value, the complete list does not show up. I am using filter method for it, I am not understanding how can I get the full list back. //search ...
shruthi gowda's user avatar
2 votes
2 answers
59 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
1 answer
32 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
-1 votes
1 answer
72 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 vote
1 answer
67 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
43 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
47 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
44 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
0 answers
79 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
  • 123
0 votes
1 answer
56 views

Capture data from dynamic field

I have an form that require some information. The patient name field have the functionality to be added dynamically if there are more patients. But, I can't capture data of the added field, I imagine ...
Nikollas Ohta's user avatar
-1 votes
1 answer
49 views

why not changing filtered sort data?

I am Currently Creating Filter Option to Item List. but its not filtering when i select the dropdown options. Array in App.jsx const cameraShowList=[ {id:1,model:"Canon",title:"...
Y Nawodya's user avatar
  • 321
0 votes
3 answers
412 views

usestate variable increments when I click on a different increment button

so I am declaring a usestate variable as "count" and I am mapping through a list of 2 items. This code shows the variable declaration and the function to increment and decrement const [count,...
Olaoluwa Anigboro-Napoleon's user avatar
0 votes
1 answer
618 views

Payload values not setting

I really do not know how to accurately present the issue I am facing but I'd really appreciate anyone who can guide me and I will be willing to provide more details if there needs to be clarity. So ...
Olaoluwa Anigboro-Napoleon's user avatar
-1 votes
1 answer
72 views

Weird behviour when trying to update an array in reactjs

import { useRef, useState } from "react"; import "./styles.css"; export default function App() { const [array, setArray] = useState(["apple", "mango", "...
info campus's user avatar

15 30 50 per page
1
2 3 4 5
55