shirakaba / react-nativescript

React renderer for NativeScript
https://react-nativescript.netlify.com
MIT License
280 stars 14 forks source link

Crashing when you navigate using page/frame to page #61

Closed t1amat9409 closed 3 years ago

t1amat9409 commented 3 years ago

https://github.com/shirakaba/react-nativescript/blob/3e30852c36c81fd0bcc10c5436c77a575efa9e1b/react-nativescript/src/client/HostConfig.ts#L316

I'm not sure why it's doing so, I had to comment that line out for now.

shirakaba commented 3 years ago

Not sure. 🤔 I’ll need a minimal working example in order to investigate this.

t1amat9409 commented 3 years ago

When trying to navigate using this old way:

    Frame.topmost().showModal(this.absoluteLayoutPageRef.current!.nativeView, {
      context: {},
      closeCallback: () => {
        // this.closeCallback(true);
      },
      animated: true,
      fullscreen: true,
      stretched: false
    })

The line below throws an error, saying container does not have method appendChild:

https://github.com/shirakaba/react-nativescript/blob/3e30852c36c81fd0bcc10c5436c77a575efa9e1b/react-nativescript/src/client/HostConfig.ts#L308

shirakaba commented 3 years ago

@t1amat9409 In app.ts, could you set __DEV__ to true:

Object.defineProperty(global, '__DEV__', { value: true });

... And then show me the logs that are output after Frame.topmost().showModal() is called, including the error's stack trace?

And also could you show me what console.log(Frame.topmost()) returns before you call Frame.topmost().showModal()?

shirakaba commented 3 years ago

Closing this for now, as there have been many improvements to navigation recently, and I need a minimal reproduction in any case.