All Questions
824 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 ...
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 ...
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 &...
-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 ...
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 ...
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:(...
-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 ...
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 [...
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
...
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":
...
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 ...
-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:"...
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,...
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 ...
-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", "...