react-native-lazyload icon indicating copy to clipboard operation
react-native-lazyload copied to clipboard

undefined is not an object (evaluating 'react.PropTypes.shape') ?

Open ghost opened this issue 7 years ago • 5 comments
trafficstars

ghost avatar Feb 19 '18 16:02 ghost

Having same error in react-native v0.52.0 together with react-native-lazyload v1.1.0. Does anyone figure out the problem?

swingywc avatar May 14 '18 08:05 swingywc

Having same error ! please help me

nguyenvanphuc2203 avatar May 29 '18 03:05 nguyenvanphuc2203

+1

IliRusli avatar Jun 21 '18 02:06 IliRusli

The error happens because PropTypes in React 16 is deprecated. You should use the prop-types package from npm instead. Go to the Anim.js, LazyloadImage.js, LazyloadListView.js, LazyloadScrollView.js, LazyloadView.js. Change the import from import React, { Component, PropTypes } from 'react'; to import React, { Component } from 'react'; import PropTypes from 'prop-types'; You can also use the project of soldotno https://github.com/soldotno/react-native-lazyload-deux

SvetoslavSlavov avatar Jun 21 '18 22:06 SvetoslavSlavov

The error happens because PropTypes in React 16 is deprecated. You should use the prop-types package from npm instead. Go to the Anim.js, LazyloadImage.js, LazyloadListView.js, LazyloadScrollView.js, LazyloadView.js. Change the import from import React, { Component, PropTypes } from 'react'; to import React, { Component } from 'react'; import PropTypes from 'prop-types'; You can also use the project of soldotno https://github.com/soldotno/react-native-lazyload-deux

Thanks for helping, here is the updated repo:

https://github.com/skantus/react-native-lazyload

skantus avatar Jul 21 '19 19:07 skantus