Skip to content

Add hints for finding components or source files that cause warnings #136

Open
@nickserv

Description

I'm using create-react-app in development with react-a11y's setup in src/index.js. My developer console displays warnings as I expected, but unfortunately there are a lot of them and the stack traces only contain the line of code in react-a11y's source that fires warning, with no information on the components or source files that exhibit these warnings.

image

This seems to be fixed if I set throw to true, though it halts my entire app and displays only one error at a time (at least on React 15) which is inconvenient for development. For now setting this in my test startup script seems to be a more convenient workaround. Still, it would be nice to see multiple error sources in my app and not just its test suite.

Ideas

  1. Produce stack traces in warnings (not just errors).
  2. Display the names of React components containing errors (React does this for prop type validation) and/or the names of the tags. Line numbers would be even better but I'm not sure if this would be possible without generating stack traces or running code in VMs.
  3. Set throw option to true by default. This would probably be the easiest solution to implement, but it's the most tedious to develop with on React 15 which only shows one error at once without boundaries.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions