Giter Club home page Giter Club logo

Comments (6)

cpunion avatar cpunion commented on July 17, 2024

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

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'

from react-web.

xiamingyu avatar xiamingyu commented on July 17, 2024

打补丁怎么打

from react-web.

cpunion avatar cpunion commented on July 17, 2024

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('...', () => ...)

from react-web.

xiamingyu avatar xiamingyu commented on July 17, 2024

image
目测只有这行代码有用

from react-web.

sandofsuro avatar sandofsuro commented on July 17, 2024

我打了补丁没有用啊

from react-web.

FattySpring avatar FattySpring commented on July 17, 2024

我也不能用

from react-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.