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

Crash on Android with React Native 0.70

Open ChrisEdson opened this issue 2 years ago • 3 comments

I'm getting a crash on React Native 0.70 (works fine on 0.69) - with the error:

TypeError: Cannot read property 'layout' of null

This seems to be down to this code, which only runs on Android.

The handleModalizeContentLayout function is defined here.

Having done some console logging, on React Native 0.70, the argument that gets passed to handleModalizeContentLayout is:

{
   "_dispatchInstances":null,
   "_dispatchListeners":null,
   "_targetInst":null,
   "bubbles":null,
   "cancelable":null,
   "currentTarget":[
      "Function currentTarget"
   ],
   "defaultPrevented":null,
   "dispatchConfig":null,
   "eventPhase":null,
   "isDefaultPrevented":[
      "Function functionThatReturnsFalse"
   ],
   "isPropagationStopped":[
      "Function functionThatReturnsFalse"
   ],
   "isTrusted":null,
   "nativeEvent":null,
   "target":null,
   "timeStamp":[
      "Function timeStamp"
   ],
   "type":null
}

i.e. nativeEvent is null, whereas in React Native 0.69 it isn't.

I can't find any changes in the React Native 0.70 changelog about this - is anyone else experiencing this?

ChrisEdson avatar Nov 29 '22 18:11 ChrisEdson

I believe this is the same bug as https://github.com/jeremybarbet/react-native-modalize/issues/451

ChrisEdson avatar Nov 29 '22 18:11 ChrisEdson

It's also mentioned in #455.

darrylyoung avatar Dec 01 '22 10:12 darrylyoung

Yes, I am also experiencing it on react-native 0.71.8

Elozino avatar Jul 06 '23 17:07 Elozino