DEV Community

Discussion on: What are Props in React?

Collapse
 
w3bdesign profile image
w3bdesign

Unless you are planning to reassign the variable, it is generally considered best practice to use const instead of let.

So the code will become this:

import React from 'react';

const Cool = (props) => {
  return <p> {props.myMessage} </p>;
}; 
Enter fullscreen mode Exit fullscreen mode