reed/turbolinks-compatibility

React Native

Closed this issue · 1 comments

I posted the following on stack overflow with no answer. Perhaps turbolink-ios can help?

I am building a hybrid react-native + ruby on rails app. I am using the ```onNavigationStateChange``` in the ```WebView``` component to detect changes in the page, and use this to change the react-native navigation menu.  This works fine, but when I tried to use ```turbolinks```, there can be a change in the page but the ```onNavigationStateChange``` is not triggered.

The  ```onNavigationStateChange``` is triggered is with following code

      render() { 
        return (
          <WebView
            ref={'webview'}
            automaticallyAdjustContentInsets={false}
            source={{uri: SETTINGS_URL}}
            javaScriptEnabled={true}
            onNavigationStateChange={this.props.onNavigationStateChange}
            startInLoadingState={true}
            scalesPageToFit={true}
          />
        )
      }

This works normally, but if I turn on turbolinks, in the ROR app, the ```onNavigationStateChange``` no longer triggers.

How do I fix this?

The good news, I have tried this with Turbolinks 5 and it works!