小编klv*_*lvs的帖子

React Native,没有为索引undefined定义的路由

我想创建一个订单页面,其中包含两个选项卡下订单选项卡,我的订单选项卡.所以我创建了一个Order.js文件和另一个OrderContent.js文件.

Order.js

/* @flow */
import React from 'react'

import {
  View,
  StatusBar,
} from 'react-native'

import SplashScreen from 'react-native-splash-screen'

import HomeHeader from '../Components/HomeHeader'
import OrderContent from './OrderContent'


export default class OrdersScreen extends React.Component {
  static navigationOptions = {
    drawer: () => ({
      label: 'Orders',
    }),
  }
  static propTypes = {
    navigation: React.PropTypes.object.isRequired,
  }

  componentDidMount() {
    SplashScreen.hide()
  }
  render() {
    return (
      <View style={{flex: 1, backgroundColor: '#fff'}}>
        <StatusBar
          barStyle="light-content"
          backgroundColor={'#202930'} />
        <HomeHeader
          title="Order Page"
          navigation={this.props.navigation} /> …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-router react-native

25
推荐指数
1
解决办法
1842
查看次数

undefined不是对象(评估'RCTWebSockerManager.connect') - React Native

我一直在关注如何将现有应用程序与native native集成的指南.http://facebook.github.io/react-native/docs/embedded-app-ios.html#content

根据我们的IOS人员的建议,我对IOS方面的一些自由行动.当我的视图加载时,我得到一个带有堆栈跟踪的红色错误屏幕:

http://puu.sh/jRgDg/b844f139b2.png

(对不起,没有足够的声誉来发布图片.文字包括在下面.)

2015-08-27 22:19:37.739 [error][tid:com.facebook.React.JavaScript] 'Warning: Native component for "RCTImageView" does not exist' 2015-08-27 22:19:37.851 [info][tid:com.facebook.React.JavaScript] 'Running application "SimpleApp" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF' 2015-08-27 22:19:37.856 [error][tid:com.facebook.React.JavaScript] 'Error: undefined is not an object (evaluating \'RCTWebSocketManager.connect\') stack: connectToSocketImpl index.ios.bundle:14464 WebSocketBase index.ios.bundle:14587 WebSocket index.ios.bundle:14458 setupDevtools index.ios.bundle:46060 renderApplication index.ios.bundle:44403 run index.ios.bundle:44295 runApplication index.ios.bundle:44323 __callFunction index.ios.bundle:5552 <unknown> index.ios.bundle:5488 guard index.ios.bundle:5441 <unknown> index.ios.bundle:5488 <unknown> index.ios.bundle:5485 perform index.ios.bundle:7033 batchedUpdates index.ios.bundle:16454 batchedUpdates index.ios.bundle:6336 <unknown> …

reactjs react-native

5
推荐指数
1
解决办法
2539
查看次数

React Native定位的最佳实践,有利于flex的百分比和计算?

来自网络背景,根据窗口尺寸绝对定位元素并计算它们在布局中的位置被认为是不好的做法(或不可能).在react-native中,我们可以访问视图端口的维度React.Dimensions.

例如: let {height, width} = Dimensions.get('window')

我现在可以使用它来设置一个100px元素,方法是:

left: (width/2) - 50

我更喜欢使用更传统的css技术.是不是有理由不这样做?在浏览器中,如果用户调整窗口大小,视口可能会更改,但在移动设备上,视口大小将是静态的.

react-native

2
推荐指数
1
解决办法
934
查看次数

标签 统计

react-native ×3

reactjs ×2

javascript ×1

react-router ×1