add element string to Invariant Exception: Element type is invalid message #17527
Labels
Ran Commands
One of our bots successfully processed a command.
Resolution: Locked
This issue was locked by the bot.
Is this a bug report?
No. This is a missing usability feature that would have saved a fair amount of debugging time.
Have you read the Contributing Guidelines?
Yes.
Environment
React Native on iOS, Android, and Windows.
Environment:
OS: macOS Sierra 10.12.6
Node: 8.9.3
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.2
Android Studio: 3.0.1
Packages: (wanted => installed)
react-native: 0.49.5 => 0.49.5
react: 16.0.0-alpha.5 => 16.0.0-alpha.5
Target Platform: Windows, iOS, Android
Steps to Reproduce
import ActivityIndicator from 'react-native-windows'
instead ofimport ActivityIndicator from 'react-native'
render() { return <ActivityIndicator />; }
Actual Behavior
Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined
Expected Behavior
In the actual case, it was a render function with a bunch of tags and it wasn't immediately clear which tag was causing the problem. It would be great if the string of the tag 'ActivityIndicator' could be captured and inserted into the exception message, like this:
Invariant Violation: Element type is invalid for "ActivityIndicator": expected a string (for built-in components) or a class/function (for composite components) but got: undefined
Reproducible Demo
See steps to reproduce.
The text was updated successfully, but these errors were encountered: