标签: react-native

错误"在应用程序启动时无法获取BatchedBridge,请确保您的软件包已正确打包"

试图在Android 4.4.2上创建一个react-native项目我得到了这个错误屏幕

说错误

并且找不到任何解决方法.我尝试重新启动打包器,重新连接设备,甚至重新安装反应原生和启动新项目.在6.0.0及更高版本上,它工作得很好.

android react-native

157
推荐指数
11
解决办法
8万
查看次数

React Native:如何在按下"下一个"键盘按钮后选择下一个TextInput?

我定义了两个TextInput字段,如下所示:

<TextInput 
   style = {styles.titleInput}
   returnKeyType = {"next"}
   autoFocus = {true}
   placeholder = "Title" />
<TextInput
   style = {styles.descriptionInput}          
   multiline = {true}
   maxLength = {200}
   placeholder = "Description" />
Run Code Online (Sandbox Code Playgroud)

但是在按下键盘上的"下一步"按钮后,我的react-native应用程序没有跳转到第二个TextInput字段.我怎样才能做到这一点?

谢谢!

ios react-native

154
推荐指数
13
解决办法
13万
查看次数

React-Native - 使用Navigator组件进行自定义导航

我正在探索React Native的可能性,同时在Navigator组件的帮助下开发一个在视图之间自定义导航的演示应用程序- http://facebook.github.io/react-native/docs/navigator.html#content

主app类渲染navigator和inside Navigator返回传递的组件:

class App extends React.Component {
    render() {
        return (
            <Navigator
                initialRoute={{name: 'WelcomeView', component: WelcomeView}}
                configureScene={() => {
                    return Navigator.SceneConfigs.FloatFromRight;
                }}
                renderScene={(route, navigator) => {
                    // count the number of func calls
                    console.log(route, navigator); 

                    if (route.component) {
                        return React.createElement(route.component, { navigator });
                    }
                }}
             />
        );
    }
}
Run Code Online (Sandbox Code Playgroud)

现在app包含2个视图:

class FeedView extends React.Component {
    render() {
        return (
            <View style={styles.container}>
                <Text>
                    Feed View!
                </Text>
            </View>
        );
    }
}

class WelcomeView extends …
Run Code Online (Sandbox Code Playgroud)

javascript navigation ios reactjs react-native

150
推荐指数
1
解决办法
3万
查看次数

React-Native:应用程序尚未注册错误

我目前正在阅读React-Native教程.我从入门教程开始,在那里我做了一个新的反应原生项目并成功设法在我的设备上运行项目.

然后我启动了Props教程,我复制了代码片段并尝试再次运行该项目并在屏幕上显示以下错误消息:

javascript facebook reactjs react-native

150
推荐指数
10
解决办法
10万
查看次数

我能用反应本机构建Android应用吗?

最近推出的反应原生功能只是iOS应用程序示例和文档.

android reactjs react-native

147
推荐指数
4
解决办法
6万
查看次数

Info.plist中必须存在NSPhotoLibraryUsageDescription键才能使用相机胶卷

最近我开始收到此错误:

Info.plist中必须存在NSPhotoLibraryUsageDescription键才能使用相机胶卷.

我正在使用React Native来构建我的应用程序(我不熟悉ios本机开发),我不知道如何将此键添加到Info.plist

你能发一个例子吗?谢谢

我正在使用npm包 "react-native-camera-roll-picker": "^1.1.7"

在此输入图像描述

info.plist ios react-native

143
推荐指数
6
解决办法
13万
查看次数

无法连接远程调试器

我正在使用React.JS,当我这样做时react-native run-android(插入我的设备),我看到一个空白页面.当我摇动设备并Debug JS Remotely从选项列表中选择时,我会看到以下屏幕.

在此输入图像描述

供参考:

OS: Ubuntu 16.04
Node version is: v4.6.2
java version "1.8.0_111"
react": "15.4.1
react-native": "0.38.0
Run Code Online (Sandbox Code Playgroud)

android reactjs react-native

139
推荐指数
6
解决办法
8万
查看次数

在React Native中更改Android的包名称

我曾经react-native init MyApp初始化一个新的React Native应用程序.这创建了包含该项目的Android项目com.myapp.

更改此包名称的最佳方法是什么,例如:com.mycompany.myapp

我尝试更改它AndroidManifest.xml但它创建了其他错误,所以我假设它不是那样的.

任何的想法?

android react-native react-native-android

138
推荐指数
14
解决办法
7万
查看次数

ReactJS - 如何使用评论

你能否render在React组件中的方法中使用注释?

我有以下组件:

'use strict';
 var React = require('react'),
   Button = require('./button'),
   UnorderedList = require('./unordered-list');

class Dropdown extends React.Component{
  constructor(props) {
    super(props);
  }
  handleClick() {
    alert('I am click here');
  }

  render() {
    return (
      <div className="dropdown">
        // whenClicked is a property not an event, per se.
        <Button whenClicked={this.handleClick} className="btn-default" title={this.props.title} subTitleClassName="caret"></Button>
        <UnorderedList />
      </div>
    )
  }
}

module.exports = Dropdown;  
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我的评论显示在用户界面中.

处理评论的正确方法是什么?

更新:

谢天谢地,这有效:

'use strict';
 var React = require('react'),
   Button = require('./button'),
   UnorderedList = require('./unordered-list');

class Dropdown extends …
Run Code Online (Sandbox Code Playgroud)

reactjs react-native

137
推荐指数
13
解决办法
7万
查看次数

CocoaPods 找不到 pod "ReactCommon/jscallinvoker" 的兼容版本:

我刚刚更新到 RN v0.62 并且在 iOS 上运行应用程序给了我以下错误

!] CocoaPods could not find compatible versions for pod "ReactCommon/jscallinvoker":
  In snapshot (Podfile.lock):
    ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)

  In Podfile:
    ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)

None of your spec sources contain a spec satisfying the dependency: `ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)`.
Run Code Online (Sandbox Code Playgroud)

我删除了所有 node_modules 并做了 npm i。我也在iOS目录中安装了pod,但问题仍然存在。我也做了 pod repo 更新。

cocoapods react-native

136
推荐指数
8
解决办法
5万
查看次数