Following is my App.js
import React, { Component } from 'react';
import { Examples } from '@shoutem/ui';
export default class App extends Component {
render() {
return (
<Examples />
);
}
}
Package.json
"@shoutem/ui": "^0.21.3",
"react": "16.0.0",
"react-native": "0.50.1"
Error:
cannot read property 'shape' of undefined on iphone X,
undefined is not an object (evaluating '_react.PropTypes.shape') on iphone 7
I am getting the error as " undefined is not an object (evaluating '_react.PropTypes.shape) "
Just in case somebody else gets into this same issue, you could use my fork as a temporary fix:
yarn add "github:diegocouto/ui.git"
The PR #314 might fix most of the errors, but a lot of other libs also had to be updated in order to be able to use this package with React v16.0.0.
I work around it by patching React 16 (for the time being until the guys from shoutem would fix this)
Steps:
npm/yarn install prop-types create-react-classmodule.exports.PropTypes = require('prop-types');
let createClass;
Object.defineProperty(module.exports, 'createClass', {
get: function() {
if (!createClass) {
createClass = require('create-react-class').bind(module.exports);
}
return createClass;
}
});
Notice this patch is only valid for your local environment and everyone who clones the project and/or does 'yarn/npm install' would have to apply the patch (step 2).
Hey guys,
We've since fixed these issues with version 0.22.0 of the UI toolkit. Closing issue as resolved.
Most helpful comment
I work around it by patching React 16 (for the time being until the guys from shoutem would fix this)
Steps:
npm/yarn install prop-types create-react-classNotice this patch is only valid for your local environment and everyone who clones the project and/or does 'yarn/npm install' would have to apply the patch (step 2).