Questions:

What are props in React?

Props being important is component communication, interviewers ask this question to assess your understanding on the same one-way data flow.

Sample Answer:

Props (aka properties) are nothing but read-only inputs or parameters passed from the parent component to the child component. Props allow components to be more dynamic and reusable by enabling a one-way data binding from parent to child component.

<SampleComponent name="Tony" />

In SampleComponent, the props.name value would be “Tony”.

Related Posts