react-native-navbar
react-native-navbar copied to clipboard
Cannot read property 'displayName' of undefined
I'm getting this error when I try to run the vanilla example in my own app
import NavigationBar from 'react-native-navbar'
...
render () {
const rightButtonConfig = {
title: 'Next',
handler: () => {
alert('hello!')
}
}
const titleConfig = {
title: 'Hello, world',
}
return (
<View style={styles.overlayContainer}>
<NavigationBar title={titleConfig} rightButton={rightButtonConfig} />
<View style={styles.topBar}>
<Text>Dashboard Screen</Text>
</View>
</View>
)
}

Has anyone seen this before?
No idea, to be honest. Try to update all dependencies and reproduce it on a blank project.
I have this when I pass an empty string to a <Text>{emptyString}</Text> RN0.32
Is it possible it's a cache of some sort? We were having this issue with RN 0.35 with a component that looked like this:
const MyComponent = ({title = ''}) => {
return <Text style={styles.foo}>{title}</Text>;
}
Which was throwing this error when title was getting defaulted to ''. Then we did this:
const MyComponent = ({title = ''}) => {
return <Text>{title}</Text>;
}
And it rendered just fine. Then, we returned it back to the first version, and it continued to render properly. For a few minutes, anyways.
FWIW, yet another question about displayName
https://stackoverflow.com/questions/50737684/displayname-property-in-react-native-cant-set-it-react-native-throws