leecade / react-native-swiper

The best Swiper component for React Native.
MIT License
10.37k stars 2.35k forks source link

did not work on RN 0.61.5-Invariant Violation #1133

Open zangp opened 4 years ago

zangp commented 4 years ago

Which OS ?

Android

Version

Which versions are you using:

import * as React from 'react';
import {StyleSheet, Text, View} from "react-native";
import Swiper from 'react-native-swiper'

export class SwiperComponent extends React.Component {

  render() {
    return (
      <Swiper>
        <View>
          <Text>sss</Text>
        </View>
        <View>
          <Text>aaa</Text>
        </View>
      </Swiper>
    );
  }
}

error: Invariant Violation: Element type is invalid: expected a string(for built-in components) or a class/function(for composite components) but got:undefined.

leopacciulli commented 4 years ago

The same with me.

shubhamkackar commented 4 years ago

Facing the same issue.

Invariant Violation: Element type is invalid: expected a string(for built-in components) or a class/function(for composite components) but got:undefined.

check the render method of _default

shubhamkackar commented 4 years ago

The code is as follow

<Swiper horizontal={true}  autoplay={true} style={styles.wrapper} >
            <View style={styles.slide1}>
            <View style={styles.scrollBarHeader}>
             <Text style={styles.text}>
               Schedule A Pick-Up
             </Text>

            </View>
            <View style={styles.scrollBarBody}>
             <View style={styles.sliderImageContainer}>
               <Image source={require('../src/truck.png')}  style={styles.sliderImageA} />
             </View>
            </View>
           </View>

           <View style={styles.slide2}>
             <View style={styles.scrollBarHeader}>
                <Text style={styles.text}>
                  Refer A Friend
                </Text>
              </View>
              <View style={styles.scrollBarBody}>
              <View style={styles.sliderImageContainer}>
                <Image source={require('../src/friends.png')}  style={styles.sliderImageB} />
              </View>
             </View>
           </View>
</Swiper>

As soon as i delete the above code, my app works properly react-native v0.62.0-rc.0 react-native-swiper v1.5.14

vongohren commented 4 years ago

Use the release candidate @ArrayZoneYour is there a resong the RC have been put on hold for so long? It worked for me, in the small use case I have.

johnjoshuadablo commented 4 years ago

+1

jeanlucdu55 commented 4 years ago

Hi, same issue with latest RC, did anyone get it working?

Thanks,

Théo

tcodes0 commented 4 years ago

I could be wrong but wanted to mention there are a few nightly builds on npm that have worked for me with only minor, sometimes visual glitches. I need a nightly to avoid an android crash in my app. This nightly could have evolved into the rc, I'm not entirely sure.

dongdyang commented 4 years ago

same here