All Questions
420
questions
-3
votes
1
answer
51
views
.map function in react is bringing a error [closed]
I am writing this code in which i have to map an array in some divs...
there is first code which has the mapping and the ui
import { useContext } from "react";
import "./index.scss"...
0
votes
0
answers
17
views
Mapping a string value to an image causes, image to rendered as absolute path
How can I convert an image to a relative path,
I have used an object to map a string to an image. like this.
flags/index.ts
import ad from './ad.svg';
import ae from './ae.svg';
import af from './af....
0
votes
1
answer
24
views
How to get an array with elements that are taken in order from other arrays?
I need from this array:
const initArray = [
{
'18888': [
{
unitId: 1,
venueId: 18888,
},
{
unitId: 2,
venueId: 18888,
},
],
},
{
...
0
votes
0
answers
37
views
Map an array, but sorted by values inside the array [duplicate]
I have an array like this:
[{ "title": "Home", "url": "/", "order": 1 },
{ "title": "Services", "url": "#services&...
-2
votes
1
answer
57
views
React error message "map is not a function"
I created a search engine on my site, so that users can be searched for by their names. Suggestions for user names are supposed to appear based on the letters entered, but as soon as you click on any ...
1
vote
2
answers
83
views
Mapping in react from API
Here is the code on AddCourse.tsx. I want to show the instructors name from API. It's run fine on console log but it didn't show up in dropdown options.
const [instructorOptions, setInstructorOptions] ...
1
vote
1
answer
44
views
Mapping an array of objects nested in array of objects
Apologies if I'm missing something basic here. This is my JSON, I want to extract the "tag" value form the objects in the "cows" array. I'm not very familiar with nested data and ...
0
votes
1
answer
32
views
How to Clear and Re-Select Items Dropdown Based on Store Filter in React?
const items: any = !_.isEmpty(filters["store"])
? [...new Set(recentFound.map(({ item }: any) => item))]
: [];
I have a React application with two dropdowns: "Store" ...
-1
votes
1
answer
24
views
i cant access to user profile image even thaugh is exist
when i console.log(user) it shows every thing i made in user model that suppose to appear even the profile avatar url is showing and when i console.log(user.avatar) the console giving me undefined
...
0
votes
1
answer
58
views
Getting multiple and duplicate values after maping an array prop and then passing the maped value as prop to another component in React
I am using React with material ui and I am getting this strange bug.
I have a parent Orders page, and then passing an array of orders to the orders component like this:
<PendingComponent
...
1
vote
1
answer
23
views
Is there a better way then a "KeyableShell" component?
Consider a list like titles.
const titles = [
<Title>Home</Title>,
<Title>Search</Title>,
<Title>Library</Title>,
<Title>Profile</Title>,
];
If ...
0
votes
0
answers
21
views
How would I create a React application that keeps track of characters' status for writing a story?
I have been working on a project to try and make a react application that displays the chapter along with the characters stats.
Chapters list is stored globally inside App.js.
Chapters list should ...
0
votes
1
answer
30
views
Map to a div grid
I am attempting to adapt the following so that 4x4 grid has numbers 1 through n displayed. Each div cell needs an onclick handler.
I tried tinkering the last response from Rendering a chart with ...
0
votes
1
answer
533
views
Dynamic Routing from Public data.json file in React
I am trying to implement dynamic routing using data stored in a data.json file stored inside my public folder in a React project. The idea is to create a Airbnb-style site where a user could view a ...
0
votes
2
answers
208
views
Property 'map' does not exist on type 'never' when map through array
getting array from API and storing it into Movie state but when I try to map that movie I got the error:
"Property 'map' does not exist on type 'never'."
import { useEffect, useState } ...