All Questions
8,725 questions
0
votes
1
answer
66
views
Submit Form as array with Inertia in React
Please I am developing an application with React JS, Inertia and Laravel that require users to submit their academic qualifications. I want the user to be able to add additional form row for more ...
0
votes
4
answers
97
views
Not able to sort an array of objects initiated using the useState hook
I have an array of items declared using the useState hook:
const [items, setItems] = React.useState([{id: 1, title: "Example Item"}, {id: 2, title: "Another example item"}])
I ...
0
votes
2
answers
72
views
Loop through a state array in React and switch each item to true using setTimeout
I have an array in state:
const [show, setShow] = useState([false, false, false, false])
These affect whether or not an image is displayed.
I'd like to iterate through them one by one, using a delay ...
0
votes
0
answers
28
views
no suitable HttpMessageConverter found for response type [class java.lang.reflect.Array] and content type [application/json]
I am calling another api using RestTemplate but it return error
Here is the code
@Autowired
private RestTemplate restTemplate;
@Override
public User getUser(String userId) {
User user = ...
0
votes
2
answers
73
views
filter out object in array if object key value is null
I need to filter out objects in array if specific key value is null.(trying to learn)
const getPlayerData = async () => {
const allPlayers = await fetchData("https://api.sleeper.app/v1/...
0
votes
1
answer
44
views
React useContext(): Objects are not valid as a React child when trying to execute function in useContext() api to fetch data
I want to fetch the data by running the API in the useContext() api, basically this API gives me the number of items added in the cart and I need that number only which Im using it in Cart.js ...
-1
votes
2
answers
62
views
Access Javascript object nested values by dynamic props in React
Is it possible to use dynamic props to get the nested value of Javascript object as below, because I am getting error with this. please suggest me any solution.
Component.
import Link from "next/...
2
votes
2
answers
61
views
React transform data using reduce
I need to transform the following structure using React.
export const bodyRows = [
{
row: [{ cell: "Name" }, { cell: "Allan, Trent" }, { cell: "Smith, Nathan" }, { ...
0
votes
1
answer
37
views
react redraw only updated array object when property changes using array.map
I would have guessed that this question is a dupe, but I searched and I can't find it...
Full source for this q is here: https://github.com/micahg/arraytest.
Using react, I'm mapping an array of ...
0
votes
2
answers
87
views
Can't add an object to an array because it's not the type "never" in react
I'm trying the following code: https://playcode.io/2047320
import React, { useState } from 'react';
export default function App() {
const [example, setExample] = useState([]);
const ButtonClick =...
0
votes
1
answer
30
views
Attempting to output text that's within an array in another array - React JS
I'm trying to expand the functionality of my tab array to be able to have a back and forth button like in chrome, allowing users to go through their history within that tab.
Example of tabArray
const [...
0
votes
0
answers
68
views
Why is json server not getting other items in the object i'm trying to fetch
I opened a json-server to serve my data so I can get data from it as my endpoints but whenever I try to get other items in the object, it always returns the first item of the object regardless of the ...
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 ...
0
votes
3
answers
78
views
Anomaly in Updating React Array State
Updating state of array didn't work like expected!
I'm making a Tic-Tac-Toe Game with this detail:
I have a state called gameBoardState (an 3x3 array) that contains the position of 'X' & 'O' with ...
0
votes
1
answer
23
views
Images wont load from array into Slideshow in react js [closed]
Hello there friendly People from Stack overflow,
I'm working on a little Homepageproject and trying to build an Imagecarrusell. So I thought it would be a good Idea making a .js file only for an const ...