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 'bool' of undefined #102

Open
marcoizzo opened this issue Oct 12, 2017 · 8 comments
Open

Cannot read property 'bool' of undefined #102

marcoizzo opened this issue Oct 12, 2017 · 8 comments

Comments

@marcoizzo
Copy link

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
Copy link

..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
Copy link

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
Copy link

BANG88 commented Oct 18, 2017

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

@ScreamZ
Copy link

ScreamZ commented Oct 21, 2017

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

@Jacse
Copy link

Jacse commented Nov 5, 2017

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
Copy link

ScreamZ commented Nov 6, 2017

@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
Copy link

Jacse commented Nov 6, 2017

@ScreamZ I wholeheartedly agree, thanks for the link.

@Jacse
Copy link

Jacse commented Nov 15, 2017

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

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

6 participants