How to use the dotnetify/react-native.connectionStateHandler function in dotnetify

To help you get started, we’ve selected a few dotnetify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dsuryd / dotNetify-react-native-demo / App.js View on Github external
constructor(props) {
    super(props);

    dotnetify.connectionStateHandler = (state, ex) => {
      this.setState({ connectionStatus: state == 'connected' ? null : state });
      if (state == 'error') Alert.alert('Connection Error', ex.message, [ { text: 'OK' } ], { cancelable: false });
    };
  }