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

Cannot read property 'x' of undefined - Something I'm missing?

Open GantMan opened this issue 9 years ago • 6 comments

I've got to be missing something basic, but for the life of me I don't know what it is.

Copy/Paste example from readme, yes I have navigator in props.

      <Lightbox navigator={this.props.navigator}>
        <Image
          style={{ height: 300 }}
          source={{ uri: 'http://knittingisawesome.com/wp-content/uploads/2012/12/cat-wearing-a-reindeer-hat1.jpg' }}
        />
      </Lightbox>

:boom: BOOM:

https://github.com/oblador/react-native-lightbox/blob/master/LightboxOverlay.js#L187 simulator screen shot apr 1 2016 8 30 18 am

React Native 0.22 - https://github.com/infinitered/react_native_base/tree/light-box

GantMan avatar Apr 01 '16 13:04 GantMan

I also met this problem @React Native 0.22 Android

zhongjie-chen avatar Apr 08 '16 06:04 zhongjie-chen

:+1: I'm getting this same issue.

markrickert avatar Apr 14 '16 22:04 markrickert

I fixed this by changing passProps to props:

https://github.com/hartmamt/react-native-lightbox/blob/master/Lightbox.js#L100

I can do a PR if this makes sense to anyone. I'm not sure if this is the right solution. I think NavigatorIOS supports passProps, but Navigator doesn't (at least not on Android from what I can tell).

hartmamt avatar Apr 19 '16 10:04 hartmamt

A PR would be cool, I encounter the same problem

DanielMSchmidt avatar Jun 01 '16 22:06 DanielMSchmidt

I have same issue and when I change it to props, it doesn't help. And it is related to origin is empty. Below is from result from console.log of

console.log(this.props); console.log(origin);

Result---

Object {navigator: Constructor, springConfig: Object, backgroundColor: "black"} LightboxOverlay.js:187 undefined

nidzovito avatar Jul 25 '16 07:07 nidzovito

Hey guys , this problem is related to what you set in your navigator: <SceneComponent navigator={navigator} route={route} {...route.passProps}/>
If there is passProps , everything is ok, if not , you should modify it. Good luck !!

rocwong-cn avatar Sep 06 '16 09:09 rocwong-cn