ultimate-react-course
ultimate-react-course copied to clipboard
PropType validation error in CityList.jsx and CityItem.jsx in WorldWise project
If you are following and coding along, you might have come across this error yourself as well, i.e in the Implementing the Cities video. When you try to pass the city prop to the CityItem.jsx component then you might have come up with this error where it is asking to specify the types of prop that you are passing.
country' is missing in props validation react/prop-types 7:22 error 'country.emoji' is missing in props validation react/prop-types 8:22 error 'country.emoji' is missing in props validation react/prop-types
It is turning out to be like this and for the time being, I have added prop types for each props being passed. If anyone has succesfully resolve this error. Please do leave any resources/ comment that could help me.
Thanks and regards
Hey there, Yes in vite, normally eslint's react rules are strict when it comes to prop validation, you can turn it off by doing the following.
- Go to your eslint config file.
- Search for the rules object.
- Under it, write the following:
react/prop-types: false
Let me know if it worked for you!
You can simply ignore that warning by adding the "react/prop-types": "off"
to the end of the rules Object inside your eslint config file
3. react/prop-types: false
please it's doesn't work for me i dont know maybe you have any other solution