Calling one javascript in another using React Native

I want to call one module from one javascript to another. I am currently downloading the GiftedMessanger demo

And I created my own native (ios) response code, I add all the GiftedMessanger dependency to my code and successfully load all the node modules. Now the demo code of GiftedMessager index.ios.js contains

'use strict';

var React = require('react-native');
var {
  AppRegistry
} = React;


AppRegistry.registerComponent('GiftedMessengerExample', () => require('./Navigation'));

and all code is working correctly. I do the same in my code. I want to call GiftedMessanger as a separate page when I click on the button so-written code,

var MessageBox = require('./Navigation');

var MyCode = React.createClass({

  _openGiftedMessanger(){
    return (<MessageBox />);
  },

  render: function() {
    <View style={styles.container}>
       <TouchableHighlight
            style={styles.imButton}
            onPress={this._openGiftedMessanger}>
            <Text>Open Chat Room</Text>
       </TouchableHighlight>
    </View>
  }
});

The above is now open. And on the console, too, without throwing an error. Where is my mistake calling javascript code.

+4
source share
1

:

_openGiftedMessanger(){
    return (<MessageBox />);
  },

, Navigator NavigatorIOS. :

this.props.navigator.push({
  title: 'Gifted messenger',
  component: MessageBox
});
0

All Articles