react-native-navbar icon indicating copy to clipboard operation
react-native-navbar copied to clipboard

Cannot read property 'displayName' of undefined

Open tonyxiao opened this issue 9 years ago • 4 comments

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>
    )
  }

image

Has anyone seen this before?

tonyxiao avatar May 09 '16 00:05 tonyxiao

No idea, to be honest. Try to update all dependencies and reproduce it on a blank project.

Kureev avatar May 13 '16 05:05 Kureev

I have this when I pass an empty string to a <Text>{emptyString}</Text> RN0.32

mschipperheyn avatar Aug 30 '16 21:08 mschipperheyn

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.

liamfd avatar Nov 14 '16 21:11 liamfd

FWIW, yet another question about displayName

https://stackoverflow.com/questions/50737684/displayname-property-in-react-native-cant-set-it-react-native-throws

wzup avatar Jun 07 '18 10:06 wzup