Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PropType validation error in CityList.jsx and CityItem.jsx in WorldWise project #53

Open
Aditya-Ghosh-27 opened this issue Feb 26, 2024 · 3 comments

Comments

@Aditya-Ghosh-27
Copy link

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

@Aditya-Ghosh-27 Aditya-Ghosh-27 changed the title PropType validation error in CityList.jsx and CityItem.jsx PropType validation error in CityList.jsx and CityItem.jsx in WorldWise project Feb 26, 2024
@yonathandevpro
Copy link

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.

  1. Go to your eslint config file.
  2. Search for the rules object.
  3. Under it, write the following: react/prop-types: false

Let me know if it worked for you!

@hoapooh
Copy link

hoapooh commented Sep 4, 2024

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
image
image

@Areolaadeleke
Copy link

3. react/prop-types: false

please it's doesn't work for me
i dont know maybe you have any other solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants