Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 581 Bytes

05-what-are-props.md

File metadata and controls

20 lines (12 loc) · 581 Bytes

Props in React

Props are properties in react, that are passed to a component. It allows for a component to be dynamic and customizable.

You can pass props to a component by using the props keyword.

Props in Components

To receive props, you need to define them in the component. Then you can access them in the component.

Note

Props are objects, and they can be accessed using the props keyword.

Passing Props

To pass props to a component, you need to write the props in the component's opening tag.

The syntax is as if you were using an attribute in HTML.