DEV Community

Discussion on: Pro Tips For Designing Robust React Components

Collapse
 
calag4n profile image
calag4n • Edited
const Person = ({ person }) => {
  const { person } = props;
  // You can validate `person` object here, for example
  const { name, age, skill } = person;
  return ([...])
};
Enter fullscreen mode Exit fullscreen mode

Nice post ✌️ although you are trying to destructur person twice here . props doesn't exist

Collapse
 
zenulabidin profile image
Ali Sherief

Thanks for finding that error. I fixed it.