Way way you want to use you component depends on how your component is implemented and its a matter of personal preference as well. The functional component is passed as props
as argument post which you may prefer to use it as it is or destructure it
Choice 1: const Checkbox = props => {}
Most often you may use the above method when there are too many props that you wish to use or pass all of them down to the child component
Choice 2: const Checkbox = ({name, value}) => {}
The above pattern is where you destructure name
and value
from props. You may choose to do so when you only need to use name
and value
out of all the props passed
manpreet
Best Answer
2 years ago
What is the preferred/correct choice for ReactJS stateless component's parameter? Is it props or list out all prop names?
Choice 1:
Choice 2: