反应原生导航器渲染方法错误

时间:2016-06-17 14:41:04

标签: javascript react-native

更新

错误信息如下:

元素类型无效:期望一个字符串或一个类/函数,但得到了对象。请检查' Navigator'。

的渲染方法

我是javascript的新手并做出本土反应,任何建议都会感激不尽。

class testiOS extends Component {

  render() {
    return (
      <Navigator
        initialRoute={{name: 'home'}}
        renderScene={this._renderScene}
      />
    );
  }

  _renderScene(route, navigator) {
    if (route.name === 'home') {
      return(<Home navigator={navigator} />);
    }
  }
}

这是主页组件:

 class Home extends Component {

   render() {
     return(
       <View>
         <TextInput
           placeholder="Input and click search"
         />
       </View>
     );
   }

 }

1 个答案:

答案 0 :(得分:1)

错字。而不是initialRoute应该是SELECT 'Order Number'=Case WHEN GROUPING(o.order_reference) = 1 Then 'Grand Total:' ELSE o.order_reference END, 'Orders Raised' = COUNT(distinct o.unid), 'Named Workers' = SUM(CASE o.named_worker WHEN 'Yes' THEN 1 ELSE 0 END) FROM orders o WHERE o.order_reference = 'BCC-015212' Group By o.order_reference WITH ROLLUP ORDER BY o.order_reference Returned Results: Order Number | Orders Raised | Named Workers Grand Total: | 1 | 1 BCC-015212 | 1 | 1