Repo:
- In a new (instructions) or existing react-native app.
- Ensure that you are using react 15.5.0 or later (reason)
- Install react-native-components-viewer:
npm install --save react-native-components-viewer
- Add the react-native-components-viewer import to
App.js/tsx or any component. import ComponentsViewer from 'react-native-components-viewer';
- When the component that imports
ComponentViewer is rendered the app will error with either TypeError: Cannot read properties of undefined (reading 'node') or Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication).
Root-cause:
This appears to be caused by PropTypes being moved from react to the community supported prop-types library.
Fix:
Port to the prop-type library. See PR #5