Can someone help me in figuring out wha is the best way to use setNativeProps in RN?.
In my react function component I did something like this
const AutoComplete = (props) => {
let parentViewRef = null
useEffect(() => {
setTimeout(function(){ console.log(parentViewRef) }, 3000)
},[])
return(
<View
ref={(viewRef) => {
parentViewRef = viewRef
}}
style={styles.modelOpenViewMain}> <View style={styles.modelOpenInputView}>
</View>
</View>
)
}
}
But unfortunately my parentViewRef is coming out to be undefined. Any idea what I could be doing wrong?