新手理解Navigator的教程



  • @mozillo 说:

    r defaultComponen

    代码里面的export可以也写出来吗?新手表示看晕





  • @JYoung_Li 说:

    好,周末我再精简一下



  • Navigator里的手势只能用于跳转已经创建的Page, 不知道能不能有什么trick可以用向右的手势来创造(push或者replace)新的page



  • @Kiri 可以自己处理手势然后调用navigator.push或replace



  • 有什么办法能用Navigator外的控件来控制Navigate的转跳吗,比如

    <Navigator ... />
    <Button onPress={/*控制Navigator内的页面转跳*/} />
    


  • @LzxHahaha 将Navigator暴露出来,比如

    <Navigator ref={nav => global.nav = nav} ... />
    <Button onPress={/* nav.push/pop  */} />
    


  • @sunnylqm 嗯,问题解决了,谢谢



  • This post is deleted!


  • This post is deleted!


  • 可以给个demo吗 楼主



  • 绝赞~!学习了!



  • 您好,如果在RN应用中要调用一个OC方法,并且方法中需要传入一个视图控制器参数,这种情况在RN中应该如何处理呢?



  • 很棒的帖子。。谢谢大侠



  • 这个例子怎么能够在android下跑起来呀,弄半天,不能跑啊
    是不是需要建立三个文件,index.android.js,还有first,second这两个,然后把对应的三段代码复制进去,保存在同一目录下,然后run-android????,请知道的高手 帮忙给说说,谢谢



  • @souther 我已经在安卓上跑了起来了,他里面基本正确,但是还欠一些符号,比如,号,你需要修改一下,不过这个教程已经很详细了。



  • 您好,我按照您的教程在安卓的模拟器上使用,在选择chrome in debug的模式下,就无法从第一个页面跳转到第二个页面,,不选择debug模式,就可以正常的跳转。请问如何解决?



  • @qew4 能说明下哪里缺少,号么,另外,你是如何跑起来的,是我说的三个文件么?谢谢



  • 0_1453095565436_QQ图片20160118133914.png
    如何用navigator实现modal的效果呢?



  • Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of Navigator.reactConsoleError @ ExceptionsManager.js:78console.error @ YellowBox.js:49warning @ warning.js:42ReactElementValidator.createElement @ ReactElementValidator.js:261_reactNative2.default.createElement.renderScene @ NavigatorComponent.js:23React.createClass._renderScene @ Navigator.js:1077(anonymous function) @ Navigator.js:1107React.createClass.render @ Navigator.js:1101ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext @ ReactCompositeComponent.js:763ReactCompositeComponentMixin._renderValidatedComponent @ ReactCompositeComponent.js:785wrapper @ ReactPerf.js:70ReactCompositeComponentMixin._updateRenderedComponent @ ReactCompositeComponent.js:721ReactCompositeComponentMixin._performComponentUpdate @ ReactCompositeComponent.js:702ReactCompositeComponentMixin.updateComponent @ ReactCompositeComponent.js:612wrapper @ ReactPerf.js:70ReactCompositeComponentMixin.performUpdateIfNecessary @ ReactCompositeComponent.js:538ReactReconciler.performUpdateIfNecessary @ ReactReconciler.js:115runBatchedUpdates @ ReactUpdates.js:151Mixin.perform @ Transaction.js:140Mixin.perform @ Transaction.js:140assign.perform @ ReactUpdates.js:94flushBatchedUpdates @ ReactUpdates.js:175wrapper @ ReactPerf.js:70Mixin.closeAll @ Transaction.js:213Mixin.perform @ Transaction.js:154ReactDefaultBatchingStrategy.batchedUpdates @ ReactDefaultBatchingStrategy.js:66enqueueUpdate @ ReactUpdates.js:208enqueueUpdate @ ReactUpdateQueue.js:24ReactUpdateQueue.enqueueSetState @ ReactUpdateQueue.js:233ReactComponent.setState @ ReactComponent.js:75React.createClass.push @ Navigator.js:917_pressButton @ FirstPageComponent.js:30React.createClass.touchableHandlePress @ TouchableOpacity.js:116TouchableMixin._performSideEffectsForTransition @ Touchable.js:689TouchableMixin._receiveSignal @ Touchable.js:607TouchableMixin.touchableHandleResponderRelease @ Touchable.js:395invokeGuardedCallback @ ReactErrorUtils.js:27executeDispatch @ EventPluginUtils.js:98executeDispatchesInOrder @ EventPluginUtils.js:121executeDispatchesAndRelease @ EventPluginHub.js:43executeDispatchesAndReleaseTopLevel @ EventPluginHub.js:54forEachAccumulated @ forEachAccumulated.js:23EventPluginHub.processEventQueue @ EventPluginHub.js:287runEventQueueInBatch @ ReactEventEmitterMixin.js:18ReactEventEmitterMixin.handleTopLevel @ ReactEventEmitterMixin.js:45merge._receiveRootNodeIDEvent @ ReactNativeEventEmitter.js:120merge.receiveTouches @ ReactNativeEventEmitter.js:205__callFunction @ MessageQueue.js:176(anonymous function) @ MessageQueue.js:82guard @ MessageQueue.js:38callFunctionReturnFlushedQueue @ MessageQueue.js:81onmessage @ debuggerWorker.js:39
    ExceptionsManager.js:63 Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of Navigator.


Log in to reply