Skip to content

Latest commit

 

History

History

props

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

React Props

An example on passing props to React components.

Props are things that are passed to a React component. Props can be JavaScript values, functions, objects, and JSX components (single, nested component with children, etc).

Prop Types

Since we are using TypeScript in this project, we have 2 ways to define prop types:

  • Use PropTypes from the prop-types package.
  • Use TypeScript to define the prop type. We will use this approach to define the prop types.

Setup

  1. Run the application.

    npm install
    npm start
  2. Navigate to http://localhost:3000.

Credit