Skip to content
This repository was archived by the owner on May 13, 2019. It is now read-only.
This repository was archived by the owner on May 13, 2019. It is now read-only.

react-navigation支持吗 #262

Open
Open

Description

@jjiangkm

新版本的reactnative推荐使用reactnavigation,打开后提示
image

Activity

  1. cpunion commented on Jun 26, 2017

    @cpunion

    打下面的补丁以后可以用:

    import {StyleSheet} from 'react-web'
    import { Linking } from 'react-navigation/lib/PlatformHelpers'
    
    Linking.getInitialURL = () => {
      return new Promise(resolve => {
        resolve('')
      })
    }
    
    StyleSheet.absoluteFill = StyleSheet.create({
      position: 'absolute',
      left: 0,
      right: 0,
      top: 0,
      bottom: 0
    })

    注意 import 时一定加上 .js 后缀,否则会导入 react-navigation.web.js,这个没有实现完整:

    import {
      StackNavigator,
      TabNavigator
    } from 'react-navigation/lib/react-navigation.js'
  2. xiamingyu commented on Jul 21, 2017

    @xiamingyu

    打补丁怎么打

  3. cpunion commented on Jul 21, 2017

    @cpunion

    index.ios.js:

    import './patch.js'
    require('./src') // 用 require 保证在 import patch 之后运行

    patch.js

    import {StyleSheet} from 'react-web'
    import { Linking } from 'react-navigation/lib/PlatformHelpers'
    
    Linking.getInitialURL = () => {
      return new Promise(resolve => {
        resolve('')
      })
    }
    
    StyleSheet.absoluteFill = StyleSheet.create({
      position: 'absolute',
      left: 0,
      right: 0,
      top: 0,
      bottom: 0
    })

    src/index.js

    import { AppRegistry } from 'react-native'
    import {
      StackNavigator,
      TabNavigator
    } from 'react-navigation/lib/react-navigation.js'
    
    // 你的 react native 程序代码...
    
    AppRegistry.registerComponent('...', () => ...)
  4. xiamingyu commented on Jul 25, 2017

    @xiamingyu

    image
    目测只有这行代码有用

  5. sandofsuro commented on Dec 28, 2017

    @sandofsuro

    我打了补丁没有用啊

  6. FattySpring commented on Jan 18, 2018

    @FattySpring

    我也不能用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions