设置 React Native 开发环境

improve this page | report issue


概述

React Native 是一个使用 React 构建本机 iOS 和 Android 应用程序的框架,它可以帮助您使用 Web 技术(例如,HTML、CSS 和 Javascript)快速构建本机移动应用程序。

如果您是选择 React Native 作为框架开发移动或 Web 应用程序的开发人员,那么以下部分可帮助您开始在 React Native 应用程序中使用 IBM Mobile Foundation SDK。

您可以使用自己首选的代码编辑器(如 Atom.io、Visual Studio Code、Eclipse、IntelliJ 等)来编写您的应用程序。

先决条件:设置 React Native 开发环境时,请确保您还阅读了设置 MobileFirst 开发环境教程。

安装 React Native CLI

要开始使用 React Native 开发,需要执行的第一步是安装 React Native CLI

要安装 React Native CLI:

  • 下载并安装 NodeJS
  • 从命令行窗口中,运行以下命令:
    npm install -g react-native-cli
    

将 Mobile Foundation SDK 添加到 React Native 应用程序

要在 React Native 应用程序中继续使用 MobileFirst 开发,需要将 MobileFirst React Native SDK 或插件添加到 React Native 应用程序。

了解如何将 MobileFirst SDK 添加到 React Native 应用程序。 有关应用程序开发,请参阅教程:将 Mobile Foundation SDK 添加到 React Native 应用程序

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on June 01, 2020