magicismight / react-native-lazyload

lazyload for react native
MIT License
414 stars 108 forks source link

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

Open ghost opened 6 years ago

swingywc commented 6 years ago

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

nguyenvanphuc2203 commented 6 years ago

Having same error ! please help me

IliRusli commented 6 years ago

+1

SvetoslavSlavov commented 6 years ago

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

skantus commented 5 years ago

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