jfilter / react-native-onboarding-swiper

🛳 Delightful onboarding for your React-Native app
https://www.npmjs.com/package/react-native-onboarding-swiper
Other
971 stars 179 forks source link

Android Bundling Failed With Syntax Error on React-Native-Onboarding-Swiper #121

Closed AnatuGreen closed 2 years ago

AnatuGreen commented 2 years ago

I used the starter example:

    <Onboarding pages={[
    {
      backgroundColor: '#fff',
      image: <Image source={require('./images/circle.png')} />,
      title: 'Onboarding',
      subtitle: 'Done with React Native Onboarding Swiper',
    }
    ... ]}
/>

...and my app refused to bundle and gave me this error:


Android Bundling failed 9647ms
SyntaxError: C:\Users\MyDirectory\MyAppDirectory\OnboadingScreen.js: Unexpected token (17:8)

  15 |       subtitle: 'Done with React Native Onboarding Swiper',
  16 |     },
> 17 |     ... ]}
     |         ^
  18 | />
  19 | }

What do I do? My app is Javascript-based.

AnatuGreen commented 2 years ago

Found out that I had to add other pages in place of the ..., like this:


 <Onboarding pages={[
    {
      backgroundColor: '#fff',
      image: <Image source={require('./images/circle.png')} />,
      title: 'Onboarding',
      subtitle: 'Done with React Native Onboarding Swiper',
    },
 {
      backgroundColor: '#fff',
      image: <Image source={require('./images/circle.png')} />,
      title: 'Onboarding',
      subtitle: 'Done with React Native Onboarding Swiper',
    },
 {
      backgroundColor: '#fff',
      image: <Image source={require('./images/circle.png')} />,
      title: 'Onboarding',
      subtitle: 'Done with React Native Onboarding Swiper',
    }
]}
/>