Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何呈现包含react native视图的函数?_Javascript_Reactjs_React Native - Fatal编程技术网

Javascript 如何呈现包含react native视图的函数?

Javascript 如何呈现包含react native视图的函数?,javascript,reactjs,react-native,Javascript,Reactjs,React Native,如何呈现包含react native视图的函数?我得到的是一个空白的白色屏幕 这不起作用: class App extends React.Component { render() { return ( <View style = { styles.container }> {this._renderMapView.bind( this )}

如何呈现包含react native视图的函数?我得到的是一个空白的白色屏幕

这不起作用:

    class App extends React.Component {
        render() {
            return (
                <View style = { styles.container }>
                    {this._renderMapView.bind( this )}
                </View>
            );
        }

        _renderMapView () {
             return <MapView style = { styles.mapView } </MapView>
        }
   }
类应用程序扩展了React.Component{
render(){
返回(
{this._renderMapView.bind(this)}
);
}
_renderMapView(){

return可能是因为renderMapView没有返回任何内容

 _renderMapView () {
          return  <MapView style = { styles.mapView } </MapView>
 }
\u renderMapView(){

return可能是因为renderMapView没有返回任何内容

 _renderMapView () {
          return  <MapView style = { styles.mapView } </MapView>
 }
\u renderMapView(){

return试试这个。不要使用
绑定(这个)


因为您正在调用函数。

请尝试此操作。不要使用
bind(this)


因为您正在调用一个函数。

在返回的renderMapView missing()中尝试以下操作:

类应用程序扩展了React.Component{
render(){
返回(
{this._renderMapView.bind(this)}
);
}
_renderMapView(){

return(在return\u renderMapView missing()中尝试以下操作:

类应用程序扩展了React.Component{
render(){
返回(
{this._renderMapView.bind(this)}
);
}
_renderMapView(){

return(最终得到答案remove bind and add return()

谢谢大家

class App extends React.Component {
    render() {
        return (
            <View style = { styles.container }>
                {this._renderMapView()}
            </View>
        );
    }

    _renderMapView () {
         return (
             <MapView style = { styles.mapView } </MapView>
        );
    }
 }
类应用程序扩展了React.Component{
render(){
返回(
{this.\u renderMapView()}
);
}
_renderMapView(){
返回(

最终得到了答案remove bind and add return()

谢谢大家

class App extends React.Component {
    render() {
        return (
            <View style = { styles.container }>
                {this._renderMapView()}
            </View>
        );
    }

    _renderMapView () {
         return (
             <MapView style = { styles.mapView } </MapView>
        );
    }
 }
类应用程序扩展了React.Component{
render(){
返回(
{this.\u renderMapView()}
);
}
_renderMapView(){
返回(

我也没有回来,也没有出来。
class App extends React.Component {
    render() {
        return (
            <View style = { styles.container }>
                {this._renderMapView.bind( this )}
            </View>
        );
    }

    _renderMapView () {
         return (<MapView style = { styles.mapView } </MapView>);
    }
 }
class App extends React.Component {
    render() {
        return (
            <View style = { styles.container }>
                {this._renderMapView()}
            </View>
        );
    }

    _renderMapView () {
         return (
             <MapView style = { styles.mapView } </MapView>
        );
    }
 }