Skip to content

6. props

Course: React - chapter 6

Props are the way to pass data from one component to another in React.

import React from 'react';
const Greeting = ({ name }) => {
return <h1>Hello, {name}!</h1>;
};
const App = () => {
return <Greeting name="Alice" />;
};