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

Better prop types warnigs #16069

Closed
goldylucks opened this issue Jul 5, 2019 · 1 comment
Closed

Better prop types warnigs #16069

goldylucks opened this issue Jul 5, 2019 · 1 comment

Comments

@goldylucks
Copy link

Do you want to request a feature or report a bug?
Request a feature

What is the current behavior?
React prop types warning doesn't reveal info on the component's instance

What is the expected behavior?
Print also the component's props

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
N/A

The current warnings point the developer only to the source code, and it would be AMAZING if we'll easily see which component instance caused the warnings. Consider a list with hundreds of items, each rendering a component. ATM there's no convenient way to track down the renegade instance.

So instead of the current behavior:

image

Also add:

index.js:1375 Warning: Failed prop type: The prop `latitude` is marked as required in `RestaurantListItem`, but its value is `null`.

RestaurantListItem's instance has the following props: {OBJECT_OF_PROPS_THAT_OPENS_ON_CLICK}

I currently find myself many times having to temporary do this in different components.

It seems to me like a very easy thing to add, at least for development build.

Thoughts?

I can take a swing at it with some guidance (I'd love to dip my toes in React's code)

@goldylucks
Copy link
Author

migrated here facebook/prop-types#279

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

1 participant