構建了我的第一個React Native應用程序之后,我現在確信這是未來。

by Taylor Milliman

泰勒·米利曼(Taylor Milliman)

構建了我的第一個React Native應用程序之后,我現在確信這是未來。 (After building my first React Native app, I’m now convinced it’s the future.)

After a few weeks of playing around with React Native, I just came away with my first real mobile app. It’s fairly simple, but it only took me a few days to build and I had a blast doing it.

在使用React Native玩了幾周之后,我才有了第一個真正的移動應用程序。 這很簡單,但是我只花了幾天的時間就完成了開發工作。

I created a mobile app for my favorite food blog, Smitten Kitchen.

我為我最喜歡的美食博客Smitten Kitchen創建了一個移動應用程序。

The app allows users to search through a database of over 1,000 recipes, and concisely view the necessary ingredients and directions for each one.

該應用程序允許用戶搜索包含1000多個食譜的數據庫,并簡潔地查看每個食譜的必要成分和說明。

Users can also bookmark recipes and easily share them with a friend.

用戶還可以為食譜添加書簽,并輕松與朋友分享。

I’m still waiting for permission from the blog to publish this app, but you can check out all of the code here. Note that the url for my API has been stubbed for the time being out of respect for Smitten Kitchen.

我仍在等待博客的許可以發布此應用,但是您可以在此處查看所有代碼。 請注意,出于對Smitten Kitchen的尊重,我的API的網址已被暫時刪除。

React Native不會很快消失 (React Native isn’t going away any time soon)

A common reservation among developers is that they don’t want to invest the time to learn a new technology if there’s a strong chance it will become obsolete in the near future.

開發人員的共同保留意見是,如果有很大的機會在不久的將來過時,他們就不想花時間學習新技術。

Even from my relatively minimal experience with React Native, I’ve found it to be an enormously powerful tool. I am confident it will be used in the years to come.

即使從相對最少的React Native經驗中,我也發現它是一個非常強大的工具。 我相信它將在未來幾年中使用。

Facebook, Instagram, and Airbnb all built the latest versions of their mobile apps using React Native. And here’s a list of the some other popular apps that were built using it.

Facebook,Instagram和Airbnb都使用React Native構建了最新版本的移動應用程序。 這是使用它構建的其他一些流行應用的列表 。

Jeff Meyerson, creator of the podcast Software Engineering Daily, has talked extensively about the React Native platform. He believes it will survive and continue to capture the majority of the mobile ecosystem.

播客軟件工程日報的創建者Jeff Meyerson廣泛討論了React Native平臺。 他認為,這種技術將生存并繼續占領大多數移動生態系統。

He has even speculated that Facebook may be creating their own mobile phone, which would be built specifically to support apps made with React Native.

他甚至推測,Facebook可能正在制造自己的手機,該手機將專門為支持使用React Native制作的應用而制造。

React Native與其他跨平臺工具有何不同 (How React Native is different from other cross-platform tools)

If you’re new to React Native, it’s an open source project started by Facebook. It allows developers to build cross-platform mobile apps using JavaScript. It works very similarly to React, Facebook’s popular JavaScript library for building single page web applications.

如果您是React Native的新手,那么這是一個由Facebook啟動的開源項目。 它允許開發人員使用JavaScript構建跨平臺的移動應用程序。 它的工作原理與React十分相似,它是Facebook流行JavaScript庫,用于構建單頁Web應用程序。

I’ve always been skeptical of tools that advertise themselves as cross-platform for mobile. All too often you end up with a look, feel, and performance that doesn’t quite match the native platform.

我一直對那些宣傳自己為移動平臺的跨平臺工具持懷疑態度。 通常,您最終會獲得與本地平臺不完全匹配的外觀,感覺和性能。

React Native is not like other mobile app development frameworks, such as Ionic or Cordova. Those run inside of a web view, or an “HTML5 app,” or a “hybrid app.”

React Native與其他移動應用程序開發框架(例如Ionic或Cordova)不同。 它們在網絡視圖,“ HTML5應用”或“混合應用”中運行。

You build a high performance mobile app that is indistinguishable from one that is built using Swift/Objective-C or Java.

您構建的高性能移動應用程序與使用Swift / Objective-C或Java構建的應用程序沒有區別。

That being said, it is still important to understand the intricacies and differences between platforms. The user experience for Android and iOS are fundamentally different, and you still need to build your app in a way that will feel natural on both platforms.

話雖如此,理解平臺之間的復雜性和差異仍然很重要。 Android和iOS的用戶體驗在根本上是不同的,并且您仍然需要以在兩種平臺上都感覺自然的方式構建應用程序。

In addition, if there is ever a feature that you need to add that is not yet supported by the React Native library, React Native makes it easy to write your own Native Module in the corresponding language, which can then be linked to your React Native codebase.

另外,如果有需要添加的功能,而React Native庫尚不支持,則React Native可以輕松地以相應的語言編寫自己的Native模塊 ,然后可以將其鏈接到React Native代碼庫。

如何開始 (How To Get Started)

Personally, I used this Udemy course to get started. It served as a nice refresher of react and redux, and was helpful for getting setup.

我個人是使用Udemy課程來開始學習的。 它充當了React和Redux的不錯的復習,并有助于進行設置。

And recently Facebook released Create React Native App. This tool further simplifies the initial setup process.

最近,Facebook發布了Create React Native App 。 該工具進一步簡化了初始設置過程。

If you’re already familiar with React, you can probably dive straight into the documentation. For only $10 however, the course is a bargain and walks you through the process of making four mobile apps as well as common components that you can reuse in future projects.

如果您已經熟悉React,可以直接閱讀文檔 。 但是,只需花費10美元,這門課程就可以講價,并且引導您完成制作四個移動應用程序以及可以在將來的項目中重用的通用組件的過程。

Udemy also offers a course covering Advanced React Native Concepts, for those already familiar with the platform.

Udemy還為已經熟悉該平臺的人員提供了涵蓋Advanced React Native概念的課程。

在React Native中樣式化 (Styling in React Native)

Styling in React Native takes some getting used to. React Native heavily uses CSS flexbox, something that I was not particularly comfortable with, even coming from a web background.

React Native的樣式需要一些習慣。 React Native大量使用CSS flexbox,我對此不太滿意,甚至來自網絡背景。

Luckily there are already some fantastic resources to learn about flexbox:

幸運的是,已經有了一些很棒的資源來學習flexbox:

How flexbox works — explained with big, colorful, animated gifs

flexbox的工作原理-用大尺寸,彩色動畫gif進行解釋

React Native Layout Examples

React Native布局示例

A fun game to help you practice: Flexbox Froggy

一個有趣的游戲可以幫助您練習: Flexbox Froggy

After working with React Native for a few weeks, I now have a much better understanding of flexbox, which I can apply to my next web project.

在與React Native一起工作了幾周之后,我現在對Flexbox有了更好的了解,我可以將其應用于下一個Web項目。

The current best practice is to create a styles object for each component, then apply it via inline-styles. Keep in mind that you are not actually writing CSS, so the naming of properties is a little different as well.

當前的最佳實踐是為每個組件創建一個樣式對象,然后通過內聯樣式應用它。 請記住,您實際上并不是在編寫CSS,因此屬性的命名也有所不同。

Another key difference is that you cannot use HTML tags in your javascript, because you are writing code to run on a phone, rather than in a browser. Instead, components are built with a set of base level components provided by the React Native library.

另一個主要區別是您不能在javascript中使用HTML標記,因為您正在編寫要在手機而非瀏覽器上運行的代碼。 相反,組件是由React Native庫提供的一組基本級別的組件構建的。

It takes a little getting used to, but before you know it you’ll find yourself accidentally using a <View>&lt;/View> tag in place of a <div></div> in your next web app.

這需要一點時間來適應,但是在您不了解它之前,會發現自己不小心在下一個Web應用程序中使用<View>& lt; / View>標記place of a <div> </ div>。

To get a better feel for how all of this works, take a peek at the code for a simple button component below.

為了更好地了解所有這些工作原理,請看一下下面的簡單按鈕組件的代碼。

Here’s the GitHub gist.

這是GitHub要點 。

Navigation is one of the few areas of React Native where there is not a consensus on a clear solution.

導航是React Native少數幾個在清晰解決方案上尚未達成共識的領域之一。

React Router has become the standard library of choice for the React community, but there are a number of libraries floating around in the React Native community.

React Router已經成為React社區的標準庫選擇,但是React Native社區中有很多庫在浮動。

Personally I used the React Native Router Flux library for my project which worked just fine. But I can see how you might run into some bigger issues on more complex projects.

我個人在我的項目中使用了React Native Router Flux庫,效果很好。 但是我可以看到您可能會在更復雜的項目中遇到一些更大的問題。

Luckily, React Native has already developed a massive community. New versions of the project are released every month, so I am confident that issues like navigation will be solved over time.

幸運的是,React Native已經建立了一個龐大的社區。 該項目的新版本每個月都會發布,因此我相信隨著時間的推移,導航等問題將得到解決。

開發人員體驗事項 (Developer Experience Matters)

The ability to share code between Android and iOS applications is undoubtedly a draw of React Native, but it is only a small part of what makes the tool so incredible.

在Android和iOS應用程序之間共享代碼的能力無疑是React Native的一大特色,但這只是使該工具如此令人難以置信的一小部分。

My favorite part of using React Native is the ability to reload immediately. I have used Android Studio in the past, and commonly had to deal with 30–60 second build times.

使用React Native時,我最喜歡的部分是能夠立即重新加載。 我過去使用過Android Studio,通常不得不處理30–60秒的構建時間。

This saves time and I found it easier to get into a flow state without those pesky build times to disrupt me.

這樣可以節省時間,而且我發現更容易進入流程狀態,而沒有那些煩人的構建時間來打擾我。

React Native makes mobile development fun again, and that alone is enough of a reason to try it out for your next project.

React Native使移動開發再次變得有趣,僅此一個理由就足以在下一個項目中進行嘗試。

愿意探索 (Be Willing To Explore)

React Native is a perfect example of what can happen when we apply ideas that have proven successful in one area of software (web), to a seemingly separate area (mobile).

當我們將在某個軟件領域(網絡)中已被證明成功的想法應用到看似獨立的領域(移動設備)時,React Native就是一個很好的例子。

As Haseeb Quereshi convincingly argued in his talk on convergence, as software engineers we should be converging on certain principles, languages and tools that can be successfully applied universally.

正如Haseeb Quereshi在關于融合的 演講中令人信服地指出的那樣,作為軟件工程師,我們應該集中在可以成功普遍應用的某些原理,語言和工具上。

We should want to find what really is the optimal solution.

我們應該希望找到真正的最佳解決方案。

“Keep your identity small” — Paul Graham
“讓您的身份小”-Paul Graham

Often times we become overly dogmatic within a community, which comes at the cost of gaining important insights from outside communities.

通常,我們在一個社區內變得過于教條主義,這是以從外部社區獲得重要見解為代價的。

Go explore other areas.

去探索其他領域。

If you try out React Native, you’ll see just how awesome the results can be.

如果您嘗試使用React Native,您將看到結果多么棒。

Thank you so much for taking the time out of your day to read my article.

非常感謝您抽出寶貴的時間閱讀我的文章。

To read more of my writing on Software Development and Personal Development, visit taylormilliman.me.

要閱讀有關軟件開發和個人開發的更多文章,請訪問taylormilliman.me 。

If you’d enjoy more detailed articles/tutorials about React Native, click the ? below and feel free to leave a comment below.

如果您喜歡有關React Native的更詳細的文章/教程,請單擊“?”。 請隨時在下面發表評論。

翻譯自: https://www.freecodecamp.org/news/after-building-my-first-react-native-app-im-now-convinced-it-s-the-future-d3c5e74f8fa8/

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

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

相關文章

delphi7 提示注冊過期問題

很同情你得經過~ 因為我以前也是經常遇見這個問題~就和你說得一樣~ 后來~ 我發現 下載使用的Delphi 7只能使用一個注冊碼&#xff0c;那就是:6AMD-PKG68E-DB8PP7-9SFE 3QH-9QW所以,你先把C:\Documents and Settings\Administrator\.borland文件夾下的兩個文件刪除然后用 Progra…

計算機開機引導的結果是,電腦開機顯示引導媒體是怎么回事

電腦開機顯示引導媒體是怎么回事分類&#xff1a;數據恢復常見問題|最后更新&#xff1a;2020年4月9日開機顯示重新啟動并選擇適當的引導設備或插入1.如果主機上接有可移動存儲介質(如光盤、移動硬盤、U盤等),將其拔掉,然后重啟。2.如果仍然這樣,進入主板設置中,依次檢測以下幾…

《操作系統真象還原》——0.23 操作系統是如何識別文件系統的

本節書摘來自異步社區《操作系統真象還原》一書中的第0章&#xff0c;第0.23節&#xff0c;作者&#xff1a;鄭鋼著&#xff0c;更多章節內容可以訪問云棲社區“異步社區”公眾號查看 0.23 操作系統是如何識別文件系統的 我們知道&#xff0c;一個硬盤上可以有很多分區&#xf…

mysql怎樣修改my ini_mysql修改my.ini報錯怎么辦

mysql修改my.ini報錯的解決辦法&#xff1a;首先將mysql默認編碼改成utf8mb4&#xff0c;并修改【my.ini】配置&#xff1b;然后修改變量&#xff0c;并檢查是否設置成功即可。更多相關免費學習推薦&#xff1a;mysql教程(視頻)mysql修改my.ini報錯的解決辦法&#xff1a;將mys…

golang---map類型

map 類似其它語言中的哈希表或字典&#xff0c;以key-value形式存儲數據key必須是支持或!比較運算的類型&#xff0c;不可以是函數、map或sliceMap查找比線性搜索快很多&#xff0c;但比使用索引訪問數據的類型慢100倍 Map使用make()創建&#xff0c;支持:這種簡寫方式 make([k…

易語言程序應用程序錯誤退出_為什么我退出Google并構建了一個向孩子們教授個人理財的應用程序

易語言程序應用程序錯誤退出Many of my friends thought I was crazy to leave a great position at Google to help parents and kids learn about money. Maybe they’re right.我的許多朋友都認為我為在谷歌上任職以幫助父母和孩子了解金錢而感到瘋狂。 也許他們是對的。 B…

藍疊 正在檢查服務器最新,Windows update一直停留在正在檢查更新

Windows update一直停留在正在檢查更新&#xff0c;為什么啊&#xff1f;一、查看相關服務是否開始&#xff1a;請您根據以下步驟&#xff0c;確認windows update & BITS服務設置1. 按下WinR鍵輸入“services.msc”(輸入時不要打引號)&#xff0c;并按下回車。如果此時彈出…

spring-DataSource

spring支持的dataSource有好多&#xff0c; 如&#xff1a;自帶的org.springframework.jdbc.datasource.DriverManagerDataSource ibatis、c3p0、JDBC、hibernate等等&#xff1b; 首先看第一種&#xff0c;使用自帶的datasource&#xff1a; 1、項目結構 提示&#xff1a;spri…

《Nmap滲透測試指南》—第7章7.8節后臺打印機服務漏洞

本節書摘來自異步社區《Nmap滲透測試指南》一書中的第7章7.8節后臺打印機服務漏洞&#xff0c;作者 商廣明,更多章節內容可以訪問云棲社區“異步社區”公眾號查看。 7.8 后臺打印機服務漏洞表7.8所示為本章節所需Nmap命令表&#xff0c;表中加粗命令為本小節所需命令——后臺打…

VSCODE 配置遠程調試環境

以下內容為本人的著作&#xff0c;如需要轉載&#xff0c;請聲明原文鏈接 微信公眾號「englyf」https://mp.weixin.qq.com/s/f1KZOlL92ojes-r2l9rlCw 我的需求是&#xff0c;在Windows桌面環境下&#xff0c;通過 VSCODE 遠程調試在服務器(或者其它遠程主機)的工程代碼。其實就…

html動態網頁效果代碼_教你制作網頁的第一步

Internet中有許多漂亮、美觀的網頁&#xff0c;要制作出這樣的網頁&#xff0c;必須先了解什么是網頁&#xff0c;網頁的基本組成是怎樣的。網頁又稱為Web頁&#xff0c;一般都包含圖像、文字和超鏈接等元素。按表現形式的不同&#xff0c;網頁可分為靜態網頁和動態網頁。靜態網…

Spring Cloud 7:Gateway

Zuul 網關 Zuul 是 Netfilx 開源的一個 API Gateway 服務器&#xff0c;本質是一個 Web Servlet 應用。其在微服務架構體系中提供動態路由、監控、彈性、安全等邊緣服務。 使用 Zuul 作為網關&#xff0c;其主要原因有以下幾點&#xff1a; 1、Zuul、Ribbon 以及 Consul 客戶端…

nodejs開發工程師前景_Google NodeJS運行時團隊的工程師Matt Loring訪談

nodejs開發工程師前景by Sameer Khoja通過Sameer Khoja Google NodeJS運行時團隊的工程師Matt Loring訪談 (An Interview with Matt Loring, an engineer on Google’s NodeJS Runtime team) I had the pleasure of interviewing Matt Loring (Cornell class of 2015) who wor…

計算機EI期刊2020,2020年Ei Compendex收錄的中國期刊目錄( JANUARY 1, 2020 )

該樓層疑似違規已被系統折疊 隱藏此樓查看此樓2020年Ei Compendex收錄的中國期刊目錄更新了&#xff0c;合計222本。本文根據最新 JANUARY 1, 2020 更新《2020年Ei Compendex收錄出版物期刊目錄》整理&#xff0c;需要提醒&#xff0c;目錄EI是不定時更新的&#xff0c;但根據小…

mysql聯合索引順序調整_MySQL 關于聯合索引的字段順序規則討論

聯合索引的順序&#xff0c;難道不是哪個查詢條件最多用就放在前面的嗎&#xff1f;比如商品有三個分類A&#xff0c;B&#xff0c;C&#xff0c;類似「界門綱目科屬種」那樣&#xff0c;越左類別越大。還有一個是商品來源D&#xff0c;不一定會用于查詢條件中。舉個例子&#…

python基礎-第三篇-函數編程

基本數據類型之set set是無序不允許重復的集合set創建&#xff1a;s set&#xff08;&#xff09; 創建空集合 s {11,22,33}轉換s set&#xff08;可迭代數據&#xff09;li [11,22,33,44] s set(li) print(s) #結果為{33, 11, 44, 22} 集合元素的添加與清空se {11,22,…

10個 Linux/Unix下 Bash 和 KSH shell 的作業控制實例

Linux 和 Unix 屬于多任務的操作系統&#xff0c;也就是說一個系統在同一時間段內能運行多重任務(進程)。在這個新的博客系列&#xff0c;我將會列出相關的 Linux 和 Unix 作業&#xff08;job&#xff09;控制的命令&#xff0c;你可以通過這些命令在 Bash 或 Korn 還有 POSIX…

微信小程序 - 骨架屏

骨架屏 - “與其等待網絡加載&#xff0c;不如提前給點暗示” 注&#xff1a;不適用復雜交互效果 演示 示例解釋以及使用全在index.wxml中&#xff0c;觀看需了解組件使用. 示例下載&#xff1a;微信小程序-骨架屏演示 轉載于:https://www.cnblogs.com/cisum/p/10032448.html

圖解機器學習 github_使用Github和Cloudflare建立網站的圖解指南

圖解機器學習 githubby Karan Thakkar由Karan Thakkar 使用GitHub和Cloudflare建立網站的插圖指南 (An illustrated guide to setting up your website using GitHub and Cloudflare) You should read this if…如果...&#xff0c;您應該閱讀此內容 You want to setup custo…

ajax拼接顯示不同樣式,Ajax重點整理

Ajax工作流程Ajax:在不刷新頁面的情況下向服務器請求數據1.創建XMLHttpRequest對象(俗稱小黃人)var xhr new XMLHttpRequest();XMLHttpRequest &#xff1a; http請求對象&#xff0c;負責實現ajax技術2.設置請求xhr.open(get, url);url:服務器地址3.發送請求xhr.send();4.注冊…