Skip to main content

All Questions

0 votes
1 answer
49 views

How to pass data between functional components with props?

I want to pass data {name} from Contact.js to Profile.js. I tried to use props to pass the {name} data but I couldn't. I am doing something wrong but I can not figure it out. .. I can write the name ...
Onur Alemdaroglu's user avatar
0 votes
1 answer
648 views

What is difference Between Functional component , pure class component in React? [duplicate]

I am trying to understand when to use React pure components and regular components. Components come in two types, Class components and Function components. iam confused by these words class component, ...
Janani's user avatar
  • 125
0 votes
0 answers
48 views

How to set state in parent component and access it in child component?

I have an object array (videoData) that is getting rendered inside parent component (Videocard) with the help of map function, which is also rendering a delete button along with each item. I want to ...
Apoorv Sharma's user avatar
0 votes
1 answer
24 views

State inside of component doesn't update on setInterval

I am trying to set the state of a self updating Date-obj in my App.js file. The state is then passed down into the DateTime component and works initially fine. But when the state of date updates ...
Jeffrey's user avatar
  • 35
0 votes
1 answer
791 views

Can I use a value inside a component in another component in React hooks (function component)?

component1.js const component1= (props) => { const [**selectedCountry**, setSelectedCountry] = useState(); <Dropdown onSelect={eventKey => { const { code } = countries....
oykn's user avatar
  • 190
0 votes
1 answer
574 views

Receiving Error when Trying to render array elements

I am receiving the following errors when trying to render list elements from an array : react-dom.development.js:13231 Uncaught Error: Objects are not valid as a React child (found: object with keys {...
Matt Angel's user avatar
0 votes
2 answers
114 views

How can I pass useState value from one component to another component

I have 2 components editor.js and toolbar.js, I want to pass activeTool value from Toolbar.js to editor.js. I am expecting it to be updated after each click. Editor.js import Toolbar from './Toolbar....
Rohan Hari's user avatar
0 votes
1 answer
44 views

accepting parameters with component as a function in react (quick fix)

I have the code below: files.map((fl) => <AudioFileListItem key={fl.id} id={fl.id} name={fl.name} />) I call this component in a different file called Test.js which is also a component. I am ...
Juliette's user avatar
  • 4,439
0 votes
0 answers
33 views

I try to get props to update a field but it not works (React)

I am trying to bring the props of my component, however when I open the edit modal it only brings the data of my first object. I want to bring them to EditForm so that I can update a field, but ...
Eduardo Quiñonez's user avatar
0 votes
1 answer
217 views

Share State to other component | pass data to other component

hello I'm currently learning about React, and I'm confused about how to pass data or state to another component i have Search Component like this function Search(props) { const [ query, setQuery ] = ...
Fillah Firdausyah's user avatar
1 vote
1 answer
74 views

React - Pass data in React Router

So, I'm having a hard time passing data between two unrelated components. I have this code below, but I don't know how to receive it from the other component <Button className='search__button' ...
Patrick Youssef's user avatar
1 vote
1 answer
572 views

Object missing from props in React child component

I have a parent component with two different buttons that trigger a child component which is a Modal that must show different content inside it depending on which button has triggered the Modal. Both ...
Denis's user avatar
  • 69
0 votes
1 answer
27 views

Hey, does anyone know why they are not identified

r t c and setRooms in Addroom component are not identified, someone knows why? Thanks.. App.js import Addroom from './components/Addroom.js'; import './App.css'; function App() { const [rooms, ...
HardBeard's user avatar