FuYaoDe / react-native-app-intro

react-native-app-intro is a react native component implementing a parallax effect welcome page using base on react-native-swiper , similar to the one found in Google's app like Sheet, Drive, Docs...
MIT License
3.24k stars 508 forks source link

Cannot read property 'bool' of undefined #102

Open marcoizzo opened 6 years ago

marcoizzo commented 6 years ago

After installation I get this error

img_edde50607be6-1

Also I only including the component using import AppIntro from 'react-native-app-intro'; I use react-native 0.49.3.

How can I fix this? 😭

tyloslinger commented 6 years ago

..It looks like the issue might be from the version of react (for react-native 0.49.3...its likely 16.0.0-beta.5)..

..the error you displaying doesn't give much info but if the issue is what i'm guessing (likely the change in how PropTypes are now referenced)..then u have to modify the react-native-swiper /src/index.js

import PropTypes from 'prop-types'; and update all React.PropTypes to PropTypes

..you might get a createClass error after that..modify same file as above with below changes.. import createReactClass from 'create-react-class' and replace React.createClass with createReactClass

..hope this helps..

miladnit commented 6 years ago

this step work for me.

1 . add import PropTypes from 'prop-types'; in react-native-swiper /src/index.js

  1. update all React.PropTypes to PropTypes in
    react-native-swiper /src/index.js

  2. add import createReactClass from 'create-react-class' in react-native-swiper /src/index.js

4.update React.createClass with createReactClass in react-native-swiper /src/index.js

5. add import PropTypes from 'prop-types'; and remove PropTypes from 'react'; in react-native-app-intro /AppIntro.js

BANG88 commented 6 years ago

Quick fix yarn add https://github.com/merryjs/react-native-app-intro

ScreamZ commented 6 years ago

This is all kind of hacky not suitable for stable production app, the owner should upgrade the lib...

Jacse commented 6 years ago

This happens because this lib uses FuYaoDe's own fork of react-native-swiper instead of the actual (updated) library. I'm guessing because it was missing some functions.

Two solutions: 1) Update package.json switching dependency with the actual react-native-swiper 2) Update FuYaoDe's own fork to use prop-type package.

A temporary fix is going to node_modules/react-native-app-intro/node_modules/react-native-swiper/src/index.js and node_modules/react-native-app-intro/AppIntro.js and update manually to use prop-types.

ScreamZ commented 6 years ago

@Jacse I went to https://www.npmjs.com/package/react-native-app-intro-v2, someone made the fix, this is more suitable than this kind of tricky hacks.

It's a one month issue, this is supposed to be fixed when you've a 1600+ stars software or you should mark it as not maintained anymore and give people access to fix it.

Jacse commented 6 years ago

@ScreamZ I wholeheartedly agree, thanks for the link.

Jacse commented 6 years ago

Hi again everyone. So I realised that the author is very unlikely to continue developing the component. For that reason I have spent the last two days making my own. It supports Android & iOS (even the iPhone X) and is pretty easy to setup. It does not support parallax yet, though.

You can take a look here

I would appreciate if anyone wants to test it out. You can install by doing:

yarn add https://github.com/Jacse/react-native-app-intro-slider.git