While passing prop as an argument in Person(Child Component) function why we should write props in curly braces?
App.js
import React from 'react';
import Person from './Person';
const App = () => {
return (
<div>
<Person name={"John"} />
</div>
);
}
export default App;
Person.js
import React from 'react';
const Person = ({name}) => { //I am talking about this line
return (
<div>
<h1/>My name is {name}.</h1>
</div>
);
}
export default Person;