All Questions
Tagged with reactjs react-props
3,091
questions
-1
votes
1
answer
32
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 &...
-1
votes
1
answer
43
views
Child component's Array prop isn't updated in component function
Take this example,
const SelectContainer = ({ excludeIds }) => {
const queryItems = (items) => {
return items.filter((item) => !excludeIds.includes(item.id)
}
console.log(&...
0
votes
0
answers
21
views
How can I pass a prop from child component to parent component to another child component?
I am working on a project that has a Header component and a Main component. The Header component has links that are supposed to open individual pages. The pages (other components) are supposed to be ...
0
votes
1
answer
23
views
How can i throw the string with link in props without error in Component with lable
I have a problem in React with props. I need to throw into my Component (into lable tag) string with a link. I'v done that and it works, but i have the error in browser console like "console.js:...
0
votes
0
answers
21
views
Component with Antd-Table inside and pass generic types
I have a reusable react-component in which i'm using an antd-table.
import type { TableProps } from 'antd/lib/table';
export function TableComponent_TRY<RecordType>(props: TableProps<...
-1
votes
0
answers
35
views
How can I export click event callbacks that use React state from within a component?
I'm building a Dashboard to visualize a few NLP experiments.
Here's a snippet from the Dashboard component (.tsx) I've currently written:
import { Dispatch, SetStateAction, useEffect, useState } from &...
1
vote
2
answers
299k
views
Why cannot destructure property of "undefined " as it is undefined when parent Component give values?
I'm working on a fake shopping cart project with React for The Odin Project (a free course online to learn Javascript). I'm working with Vite, React-Router, and Vitest for this project. I have created ...
1
vote
1
answer
49
views
React component receiving undefined props
I have a simple React app(created with vite), where i am passing a list of objects to a component Carts, Carts component simply parses the list and returns JSX.
But there is a error pointing that the ...
2
votes
1
answer
42
views
React component is modifying its own props without directly changing them
I have created a React component that creates a form of n inputs and a customized SubmitButton. I'm passing data, an array property, from a parent component as initial values required to be displayed ...
1
vote
1
answer
56
views
Error when trying to set Key for custom component
Using React with Typescript I am trying to do the simple thing, that is iterate through a collection of object and based on each of those - create an instance of custom component.
Given that I'm using ...
0
votes
1
answer
53
views
Playwright test failing: props return different values in Playwright testing UI and actual React app on Chrome browser
I am creating an e2e testing for my application using Playwright (version 1.44.1). I have a react 18 application (created with Vite) for a blogs app. When I run the application the UI shows correct ...
-2
votes
2
answers
51
views
unknown value in React [closed]
I have the following problem. The below code does not work as intended. The first log displays the correct value. e.g. "SomeName". But "SomeName" is not displayed in the inputName ...
0
votes
1
answer
24
views
Props not Passing Props
I have just started using React and I have this ItemMenu that suppose pass props to the Sidebar but it is not working.
I have console.log it and the props from the ItemMenu seems to be working just ...
0
votes
0
answers
53
views
Doughnut chart from chartjs2 is not population data from another component in React JS
In my project I am trying to use doughnut chart as a separate component. I am passing some values from a component to the doughnut chart component. It is not showing the correct chart. I am passing ...
0
votes
1
answer
20
views
Custom MUI fields (<TextField />) not recognizing a change in value
I'm trying to create custom form components so I don't need to update every item if I decide on a style change.The ReportSelect version does not update the value upon selection of a menu item, and the ...