ScanSkill

Props

Props are the properties of a component that are passed from one component to another. The process of passing props to a component is similar to passing parameters in a function. Props are mostly used to make a dynamic component.

Syntax

receiving props:

function MyComponent(props) {
  return <h1>{props}</h1>;
}

passing props:

<MyComponent props />

Example

function MyComponent(props) {
  return <h1>Hello {props.name}!</h1>;
}
<MyComponent name={"React"}/>
Props