‘name’ is missing in props validation eslint react/prop-types
‘description’ is missing in props validation eslint react/prop-types
export default function Note({name,description}) {
return (
<div>
<h1>{name}</h1>
<p>{description}</p>
</div>
)
}
import Note from './Note'
export default function NoteList() {
return (
<div>
<Note name="roze" description="Lorem ipsum dolor sit amet consectetur" />
<Note name="sam" description="Lorem ipsum dolor sit amet consectetur" />
</div>
)
}
2
Answers
You can try prop-types package using this command
And then for your case you can use this code
and NoteList.js Leave as is
The code is wanting you to create a type for the props being passed into the
Note
component. You can do so like this: