I want to use react-native-autocomplete-select for my project but when I am importing react-native-autocomplete-select it is giving an error . Although problem is occuring when I am trying to import it. View is working perfectly fine when i am removing this import.
[Sat Aug 08 2020 14:49:42.581] ERROR TypeError: undefined is not an object (evaluating '_react.default.PropTypes.array')
[Sat Aug 08 2020 14:49:42.583] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Sat Aug 08 2020 14:49:42.587] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
I have tried installing and importing PropTypes
here is my View
import React,{useState} from 'react';
import {StyleSheet,View,Text,Button,TextInput} from 'react-native';
import {useNavigation} from '@react-navigation/native'
import PropTypes from 'prop-types';
import AutoComplete from 'react-native-autocomplete-select'
const suggestions = [
{text: 'suggestion1', anotherProperty: 'value'},
{text: 'suggestion2', anotherProperty: 'value2'}
]
function Other(){
const navigation=useNavigation();
const [input, setInput] = useState("")
const onSelect = (suggestion) => {
console.log(suggestion) // the pressed suggestion
}
return(
<View style={styles.container}>
<View style={styles.button}>
<Button title="Menu" onPress={()=>{navigation.toggleDrawer()}} />
</View>
<View style={styles.view}>
<TextInput
style={styles.input}
onChangeText={text=>setInput(text)}
value={input}
placeholder="text here..."
/>
</View>
</View>
);
}
const styles=StyleSheet.create({
container:{
flex:1,
justifyContent:'center',
alignContent:'center'
},
button:{
position:'absolute',
top:10,
right:10,
},
view:{
padding:10,
flex:1,
marginTop:70
},
input:{
height:50,
borderColor:'#000',
borderWidth:2,padding:10,
borderRadius:5,
fontSize:18
}
});
export default Other;
please help me !!!And let me know if I am missing something here.
- "react": "16.13.1",
- "react-native": "0.63.2",
Thanks already.