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

cannot read property 'shape' of undefined #328

Closed
awnali opened this issue Nov 6, 2017 · 4 comments
Closed

cannot read property 'shape' of undefined #328

awnali opened this issue Nov 6, 2017 · 4 comments

Comments

@awnali
Copy link

awnali commented Nov 6, 2017

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

@awnali awnali closed this as completed Nov 6, 2017
@awnali awnali reopened this Nov 6, 2017
@aniketparab4
Copy link

I am getting the error as " undefined is not an object (evaluating '_react.PropTypes.shape) "

@diegocouto
Copy link

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.

@erezool
Copy link

erezool commented Nov 8, 2017

I work around it by patching React 16 (for the time being until the guys from shoutem would fix this)

Steps:

  1. npm/yarn install prop-types create-react-class
  2. Add the follwing snippet to the end of your app's node_modules/react/index.js
module.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).

@Definitely-Not-Vlad
Copy link
Collaborator

Hey guys,

We've since fixed these issues with version 0.22.0 of the UI toolkit. Closing issue as resolved.

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

5 participants