Questions tagged [react-props]

ReactJS is a JS library developed by facebook. Props are the variables to be used in react components. Use tag when having doubts regarding usage of react props.

Reactjs is a JS library developed by facebook. React relies on making of components which handle variables through props.

Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen.

-React Documentation

3283 questions
0
votes
1 answer

Receiving "Uncaught TypeError: this.props.parentCallback2 is not a function" while trying to pass data between 2 childs to parent

I am quite new to ReactJS and I am trying to make a Trello Clone. I have linked my GitHub page with my code below since its to much to put on here. My problem is I am receiving the error "Uncaught TypeError: this.props.parentCallback2 is not a…
Blazing
  • 55
  • 7
0
votes
1 answer

set the progress speed of the progress bar to be equal to the time of the percentage counter?

how to set the progress speed of the progress bar to be equal to the time of the percentage counter? the bar is at a very fast speed, while the percentage numbers shown are slowly passing from 1 to 100. I wish the two were at the same speed, as if…
0
votes
1 answer

How to get the current value and update the state (Object) of a Parent component in Children component

I have this state in my Parent component const [formData, setFormData] = useState({ firstName: "", middleInitial: "", lastName: "", imageFile: "", extension: "", mobileNumber: "", email: "", agreement1: false, …
Mel Carlo Iguis
  • 126
  • 2
  • 9
0
votes
1 answer

How I can set "key" props when render tag

I know this problem is quite common and there are many similar questions, however I still haven't been able to find a solution to my problem. I have a props renderDateTable = () => { { return ( <>
Huy Nguyen
  • 27
  • 7
0
votes
1 answer

Passing props not working in a nested function

When I pass the props to the OnBeforeSend function it works, but once I put it inside the nested args.ajaxsettings function it does not work. export default class FileManager extends React.PureComponent { hostUrl =…
marcorivera8
  • 217
  • 1
  • 5
  • 13
0
votes
3 answers

How can I send the data to the parent component by click on the button in React?

My question is how can I send the input value to the parent component by clicking on the button? Because now if I type something in the input it shanges the value instantly, I want it to do after I click on the button. Currently I am using that…
Surge
  • 81
  • 8
0
votes
1 answer

Why am I unable to pass this prop through to component 'is not assignable to type 'IntrinsicAttributes'

I'm wanting to pass savedDocuments through to SavedDocument component. savedDocuments type: type DocumentUploaderFile = { documentId: string; id: string; name: string; size: number; status: 'loaded' | 'failed' |…
meWho
  • 129
  • 1
  • 8
0
votes
1 answer

Problem in communicating props in reactjs

I am not getting the choosen program option to select user,The props supposed to communicate from program.js to enrollmentform can anyone help me figuring out why the choosen program is not appearing the code is --: My App.js Code is ---: import…
Janab Ali
  • 15
  • 1
  • 5
0
votes
1 answer

Add new dynamic components in React

I'm trying to create a new dynamic component that receives a value from its parent and is added to an array. However, that component prop must update itself and change in all the components inside the array when the original value change, but use…
0
votes
1 answer

Difference between onsubmit and onclick in react as props

I am new to react and javascript.I want to do authetication part in my web.i want test whether the status change on my parent component after onsubmit the form which i have set one button and one form in the child component with the same…
user20112858
  • 79
  • 1
  • 6
0
votes
1 answer

How to pass a parameter between functions within a child component using Typescript? Variable undefined

I am creating my own check box component using React and Typescript and wondering why my variable is being logged as undefined when passed down as props. Here is my secenario: My outer component exists as such: ./App.tsx function App() { const…
Kevin
  • 137
  • 1
  • 12
0
votes
2 answers

Location/city value is undefined after passing through other component and then render page gone blank..any solution?

I have two components "search" and "Maindata". I am passing the input value from the search component to maindata component where I want to replace the city attribute with the input value(location) in API. but the browser display went blank and the…
0
votes
1 answer

React child component doesn't update if declared inside a function

I'm working on building a multistep thing, but the steps are dynamic and are built based on some conditions coming from params. While building it I noticed that the child components are not refreshing once the state in the parent component is…
0
votes
1 answer

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 itself with a setInterval() timer, it doesn't change…
Jeffrey
  • 35
  • 6
0
votes
0 answers

NextJS: some props lost in child component

I created a project using NextJS template Blog starter kit, found here: https://vercel.com/templates/next.js/blog-starter-kit I've successfully fetched my own posts from a graphql-endpoint and can render them, but when I add values to the post…
eriksson
  • 1
  • 1
1 2 3
99
100