React Native指南

React本機 (React Native)

React Native is a cross-platform framework for building mobile applications that can run outside of the browser?—?most commonly iOS and Android applications

React Native是一個跨平臺框架,用于構建可在瀏覽器外部運行的移動應用程序-最常見的iOS和Android應用程序

It can be used to build applications on Windows devices, desktop OS’s, and Apple TV apps as well but this guide will only be covering its most common purpose?—?Android and iOS applications.

它也可以用于在Windows設備,臺式機操作系統和Apple TV應用程序上構建應用程序,但本指南僅涵蓋其最常見的用途-Android和iOS應用程序。

Table of Contents

目錄

  • What is React Native?

    什么是React Native?

  • Reasons to choose React Native

    選擇React Native的理由

  • How to Get Started with React Native

    如何開始使用React Native

什么是React Native? (What is React Native?)

React Native falls in-between native and hybrid applications on the mobile app spectrum. The user interface you create is entirely native and the overall application performance is nearly as good as writing a native app.

在移動應用程序范圍內,React Native介于本地應用程序和混合應用程序之間。 您創建的用戶界面完全是本機的,整體應用程序性能幾乎與編寫本機應用程序一樣好。

It also gives you the flexibility to embed web views (webpages) or native code (Java/Kotlin for Android, Objective C/Swift for iOS) inside your applications wherever you want.

它還使您可以靈活地將Web視圖(網頁)或本機代碼(Android的Java / Kotlin,iOS的Objective C / Swift)嵌入到所需的位置。

It follows the same pattern as React where the views (what you see on the screen) are rendered from the JavaScript files. The difference is that it supplies its own API for handling native mobile views vs the DOM on the web.

它遵循與React相同的模式,其中從JavaScript文件渲染視圖(在屏幕上看到的內容)。 不同之處在于,它提供了自己的API來處理本機移動視圖,而不是Web上的DOM。

If you are confused about how this works, follow this guide on freeCodeCamp and it will take you step by step through these concepts.

如果您對它的工作方式感到困惑,請遵循freeCodeCamp上的本指南,它將逐步引導您了解這些概念。

選擇React Native的理由 (Reasons to choose React Native)

  1. Code reusability?—?It uses one code based that is shared between both platforms.

    代碼可重用性 -它使用一種基于代碼的代碼,在兩個平臺之間共享。

  2. Reuse web tools and skills?—?Reuse JavaScript knowledge, tools and utilities like axios, Redux, and other libraries that don’t require the DOM from the web.

    重用Web工具和技能 -重用JavaScript知識,工具和實用程序,例如axios ,Redux和其他不需要Web DOM的庫。

  3. Optimized for developer productivity?—?Comes with features like hot/live module reloading and chrome developer tools for debugging out of the box!

    針對開發人員的生產力進行了優化 -帶有熱/實時模塊重新加載功能以及用于調試的chrome開發人員工具等功能!

  4. Performance?—?Performs better than hybrid application frameworks like Ionic and Cordova since it is not using web views.

    性能 —由于未使用Web視圖,因此其性能比Ionic和Cordova等混合應用程序框架更好。

  5. Corporate backing?—?Lots of companies support and contribute to React Native including Walmart, Airbnb, Wix, and, of course, Facebook.

    企業支持 -許多公司支持和貢獻React Native,包括沃爾瑪,Airbnb,Wix,當然還有Facebook。

  6. Community?—?React Native has a large (and growing) community with over 1500 contributors to the core project and thousands more who contribute to various libraries.

    社區 -React Native擁有一個龐大的社區(并且正在不斷發展),該社區有1500多個貢獻者為核心項目,成千上萬的人為各種圖書館做出了貢獻。

  7. Better user experience?—?React Native uses the JavaScript code to render native components from your phone’s OS. In other words, the application’s user interface (UI) is entirely native!

    更好的用戶體驗 -React Native使用JavaScript代碼從手機的操作系統渲染本機組件。 換句話說,應用程序的用戶界面(UI)完全是本機的!

  8. Cross-Platform - Great way to prototype and save time while building either a universal user interface or platform specific mobile application that can run on both iOS and Android devices.

    跨平臺 -在構建可在iOS和Android設備上運行的通用用戶界面或特定于平臺的移動應用程序時,實現原型和節省時間的好方法。

如何開始使用React Native (How to Get Started with React Native)

There are two quick easy ways to get started with React Native. Depending on your situation, one can be a better option for you.

有兩種快速簡便的方法可以開始使用React Native。 根據您的情況,一個可能是您更好的選擇。

  1. Create React Native App- Similar to Create React App, it gets up and running using the terminal.

    創建React Native應用程序 -與創建React App類似,它使用終端啟動并運行。

  2. Expo - Best for prototyping an app or if it is earlier stage. Using Expo you can even create a quick app using drag and drop features from snack.expo.io in the browser.

    博覽會 -最適合制作應用原型或處于早期階段的原型。 使用Expo,您甚至可以使用瀏覽器中Snack.expo.io的拖放功能來創建快速應用程序。

關于React Native的更多資源: (More resources on React Native:)

  • How to build mobile apps with React Native

    如何使用React Native構建移動應用

  • Functional vs Class Components in React Native

    React Native中的功能與類組件

  • How to test React Native Apps with Jest and Enzyme

    如何使用Jest和Enzyme測試React Native Apps

翻譯自: https://www.freecodecamp.org/news/react-native-guide/

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/390802.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/390802.shtml
英文地址,請注明出處:http://en.pswp.cn/news/390802.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

leetcode 1074. 元素和為目標值的子矩陣數量(map+前綴和)

給出矩陣 matrix 和目標值 target&#xff0c;返回元素總和等于目標值的非空子矩陣的數量。 子矩陣 x1, y1, x2, y2 是滿足 x1 < x < x2 且 y1 < y < y2 的所有單元 matrix[x][y] 的集合。 如果 (x1, y1, x2, y2) 和 (x1’, y1’, x2’, y2’) 兩個子矩陣中部分坐…

失物招領php_新奧爾良圣徒隊是否增加了失物招領?

失物招領phpOver the past couple of years, the New Orleans Saints’ offense has been criticized for its lack of wide receiver options. Luckily for Saints’ fans like me, this area has been addressed by the signing of Emmanuel Sanders back in March — or has…

教你分分鐘使用Retrofit+Rxjava實現網絡請求

擼代碼之前&#xff0c;先簡單了解一下為什么Retrofit這么受大家青睞吧。 Retrofit是Square公司出品的基于OkHttp封裝的一套RESTful&#xff08;目前流行的一套api設計的風格&#xff09;網絡請求框架。它內部使用了大量的設計模式&#xff0c;以達到高度解耦的目的&#xff1b…

線程與進程區別

一.定義&#xff1a; 進程&#xff08;process&#xff09;是一塊包含了某些資源的內存區域。操作系統利用進程把它的工作劃分為一些功能單元。 進程中所包含的一個或多個執行單元稱為線程&#xff08;thread&#xff09;。進程還擁有一個私有的虛擬地址空間&#xff0c;該空間…

基本SQL命令-您應該知道的數據庫查詢和語句列表

SQL stands for Structured Query Language. SQL commands are the instructions used to communicate with a database to perform tasks, functions, and queries with data.SQL代表結構化查詢語言。 SQL命令是用于與數據庫通信以執行任務&#xff0c;功能和數據查詢的指令。…

leetcode 5756. 兩個數組最小的異或值之和(狀態壓縮dp)

題目 給你兩個整數數組 nums1 和 nums2 &#xff0c;它們長度都為 n 。 兩個數組的 異或值之和 為 (nums1[0] XOR nums2[0]) (nums1[1] XOR nums2[1]) … (nums1[n - 1] XOR nums2[n - 1]) &#xff08;下標從 0 開始&#xff09;。 比方說&#xff0c;[1,2,3] 和 [3,2,1…

客戶細分模型_Avarto金融解決方案的客戶細分和監督學習模型

客戶細分模型Lets assume that you are a CEO of a company which have some X amount of customers in a city with 1000 *X population. Analyzing the trends/features of your customer and segmenting the population of the city to land new potential customers would …

用 Go 編寫一個簡單的 WebSocket 推送服務

用 Go 編寫一個簡單的 WebSocket 推送服務 本文中代碼可以在 github.com/alfred-zhon… 獲取。 背景 最近拿到需求要在網頁上展示報警信息。以往報警信息都是通過短信&#xff0c;微信和 App 推送給用戶的&#xff0c;現在要讓登錄用戶在網頁端也能實時接收到報警推送。 依稀記…

leetcode 231. 2 的冪

給你一個整數 n&#xff0c;請你判斷該整數是否是 2 的冪次方。如果是&#xff0c;返回 true &#xff1b;否則&#xff0c;返回 false 。 如果存在一個整數 x 使得 n 2x &#xff0c;則認為 n 是 2 的冪次方。 示例 1&#xff1a; 輸入&#xff1a;n 1 輸出&#xff1a;tr…

Java概述、環境變量、注釋、關鍵字、標識符、常量

Java語言的特點 有很多小特點&#xff0c;重點有兩個開源&#xff0c;跨平臺 Java語言是跨平臺的 Java語言的平臺 JavaSE JavaME--Android JavaEE DK,JRE,JVM的作用及關系(掌握) (1)作用 JVM&#xff1a;保證Java語言跨平臺 &#xff0…

寫游戲軟件要學什么_為什么要寫關于您所知道的(或所學到的)的內容

寫游戲軟件要學什么Im either comfortably retired or unemployed, I havent decided which. What I do know is that I am not yet ready for decades of hard-won knowledge to lie fallow. Still driven to learn new technologies and to develop new projects, I see the …

leetcode 342. 4的冪

給定一個整數&#xff0c;寫一個函數來判斷它是否是 4 的冪次方。如果是&#xff0c;返回 true &#xff1b;否則&#xff0c;返回 false 。 整數 n 是 4 的冪次方需滿足&#xff1a;存在整數 x 使得 n 4x 示例 1&#xff1a; 輸入&#xff1a;n 16 輸出&#xff1a;true …

梯度反傳_反事實政策梯度解釋

梯度反傳Among many of its challenges, multi-agent reinforcement learning has one obstacle that is overlooked: “credit assignment.” To explain this concept, let’s first take a look at an example…在許多挑戰中&#xff0c;多主體強化學習有一個被忽略的障礙&a…

三款功能強大代碼比較工具Beyond compare、DiffMerge、WinMerge

我們經常會遇到需要比較同一文件的不同版本&#xff0c;特別是代碼文件。如果人工去對比查看&#xff0c;勢必費時實力還會出現紕漏和錯誤&#xff0c;因此我們需要借助一些代碼比較的工具來自動完成這些工作。這里介紹3款比較流行且功能強大的工具。 1. Beyond compare這是一款…

shell腳本_Shell腳本

shell腳本In the command line, a shell script is an executable file that contains a set of instructions that the shell will execute. Its main purpose is to reduce a set of instructions (or commands) in just one file. Also it can handle some logic because it…

大數據與Hadoop

大數據的定義 大數據是指無法在一定時間內用常規軟件工具對其內容進行抓取、管理和處理的數據集合。 大數據的概念–4VXV 1,數據量大&#xff08;Volume&#xff09;2,類型繁多&#xff08;Variety &#xff09;3,速度快時效高&#xff08;Velocity&#xff09;4,價值密度低…

Arm匯編指令學習

ARM指令格式 ARM指令格式解析 opcode: 指令助記符,例如,MOV ,ADD,SUB等等 cond&#xff1a;指令條件碼表.下面附一張圖 {S}:是否影響CPSR的值. {.W .N}:指令寬度說明符,無論是ARM代碼還是Thumb&#xff08;armv6t2或更高版本&#xff09;代碼都可以在其中使用.W寬度說明符&…

facebook.com_如何降低電子商務的Facebook CPM

facebook.comWith the 2020 election looming, Facebook advertisers and e-commerce stores are going to continually see their ad costs go up as the date gets closer (if they haven’t already).隨著2020年選舉的臨近&#xff0c;隨著日期越來越近&#xff0c;Facebook…

Python中的If,Elif和Else語句

如果Elif Else聲明 (If Elif Else Statements) The if/elif/else structure is a common way to control the flow of a program, allowing you to execute specific blocks of code depending on the value of some data.if / elif / else結構是控制程序流程的常用方法&#x…

Hadoop安裝及配置

Hadoop的三種運行模式 單機模式&#xff08;Standalone,獨立或本地模式&#xff09;:安裝簡單,運行時只啟動單個進程,僅調試用途&#xff1b;偽分布模式&#xff08;Pseudo-Distributed&#xff09;:在單節點上同時啟動namenode、datanode、secondarynamenode、resourcemanage…