snack icon indicating copy to clipboard operation
snack copied to clipboard

Snack Bug regarding PropType Validation?

Open alishehzad2017 opened this issue 6 years ago • 4 comments

I originally created this issue on the expo repository and a Samaritan who goes by wodin said it would be better moving it to this repository.

The issue I have been experiencing is not seeing a yellow warning box on snack when I pass an incorrect Proptype.

Below is the link to the snack that demonstrates the problem: https://snack.expo.io/@alishehzad/no-warning-for-incorrect-proptype

Here count is validated in 'Count.js' and exported to 'App.js'.

This works fine locally. Just not in a snack.

Following is the link to the original question: https://forums.expo.io/t/proptype-validation-on-snack/30580

alishehzad2017 avatar Nov 29 '19 09:11 alishehzad2017

Here's a link to the snack that demonstrates the problem:

https://snack.expo.io/@alishehzad/no-warning-for-incorrect-proptype

This works fine locally. Just not in a snack.

Sorry, I think I should have said to create the issue in the snack-web repository rather than here. I hope someone can move it there.

wodin avatar Nov 29 '19 12:11 wodin

Thank you for the link to a more relevant repository and the transfering process.

Unfortunately, it seems like I dont have transfer privileges. Hence, Ive created a new issue in that repository. Below is the link: https://github.com/expo/snack-web/issues/30

alishehzad2017 avatar Nov 30 '19 00:11 alishehzad2017

Yes, I was thinking someone from the Expo team might transfer it, but since there's already a similar issue they may as well close this one.

wodin avatar Nov 30 '19 17:11 wodin

PropTypes unfortunately doesn't work. As prop-types is no longer cool, I recommend moving to typings. I've updated the example to TypeScript and it gives you hints in the editor that the count type is incorrect.

https://snack.expo.io/@ijzerenhein/no-warning-for-incorrect-proptype

image

Is this a viable solution for you?

IjzerenHein avatar Oct 22 '20 15:10 IjzerenHein