I am having an error on react-multi-carousel

723 Views Asked by At

This is my code

import MultiCarousel from "react-multi-carousel";
import { ImageBackground, Text, View } from 'react-native';
import { styles } from '../components/Styles';

const HomeScreen = props => {
    
    return (
        <View style={styles.container}>
            <View style={styles.carouselCategoryParent}>
                        <MultiCarousel responsive={responsive}>
                            <div>Item 1</div>
                            <div>Item 2</div>
                            <div>Item 3</div>
                            <div>Item 4</div>
                        </MultiCarousel>;
               </View>
        </View>
    );
}
export default HomeScreen;

This is the error I am getting on my code;


Error: Text strings must be rendered within a <Text> component.

This error is located at: 
in RCTView (at View.js:34)
in View (at HomeScreen.js:61)
in RCTView (at View.js:34)
in View (at HomeScreen.js:46)

This is what i have tried so far, hoping to get some solutions

1

There are 1 best solutions below

0
On BEST ANSWER

Just remove the ";" after the closing tag </MultiCarousel> and change <div> to <View>. <div> is not a valid element in React Native.