[學學ReactNative] DAY2 - AI建議我從這開始!


Posted by Anny on 2024-02-21

就在昨天(2024/02/20),Groq推出了採用獨創、專門處理LLM模型用的LPU,並提供了兩個開源模型( Mixtral 8x7B-32k 和 Llama 270B-4k )免費試用,有興趣的人可以至Groq官網 玩玩看。
我也玩了幾次,速度非常快,來到了500+T/s!

不過隔天再使用,就看不到上次的問答了,目前似乎不會記憶之前的問答,輸入與使用上還是chatGPT比較習慣。


AI建議我從這開始

不免俗的拿來問一下第一天學習React Native,他建議我從何開始,以下附上原文。

很高興您開始學習 React Native!以下是一些建議,可以幫助您從事 beginning to learn React Native:

  1. 先學習 JavaScript: React Native 是用 JavaScript 撰寫的,因此,了解 JavaScript 的基礎知識非常重要。如果您不熟悉 JavaScript,我建議您先學習 JavaScript 的基本概念,例如變數、數據類型、函數、數組、物件等。
  2. 了解 React 基礎: React Native 是基於 React 框架構建立的,因此了解 React 的基礎知識也很重要。了解 React 的核心概念,例如組件(Components)、 props、state、生命週期等。
  3. 跟隨官方文檔: React Native 的官方文檔是學習 React Native 的最佳資源之一。它覆蓋了 React Native 的所有基本概念,並提供了許多示例和代碼段。
  4. 實際編碼: 嘗試建立一些簡單的應用程序,以熟悉 React Native 的API和工具。您可以從官方文檔或網絡上的教程中找到一些簡單的專案。
  5. 參加社區: React Native 有一個活躍的社區,可以提供幫助和支持。您可以在 GitHub 上尋找 React Native 專屬的問題和討論,或是在 Stack Overflow 上提問。
    祝您學習愉快!

(English translation: I'm glad you are starting to learn React Native! Here are some suggestions to help you get started:

  1. Learn JavaScript first: Since React Native is written in JavaScript, it is essential to understand the basics of JavaScript. I recommend learning the basic concepts of JavaScript, such as variables, data types, functions, arrays, objects, etc.
  2. Understand the basics of React: Since React Native is built on top of the React framework, understanding the basics of React is also essential. Understand the core concepts of React, such as components, props, state, lifecycle, etc.
  3. Follow the official documentation: The official documentation of React Native is one of the best resources for learning React Native. It covers all the basic concepts of React Native and provides many examples and code snippets.
  4. Actually code: Try building some simple applications to get familiar with React Native's APIs and tools. You can find some simple projects in the official documentation or from online tutorials.
  5. Join the community: React Native has an active community that can provide help and support. You can find React Native specific issues and discussions on GitHub or ask questions on Stack Overflow.
    Happy learning!)

先跟隨官方文檔建立第一個專案吧

實戰派的我,決定先跳過第一點和第二點要了解javascript和react的部分,直接從官方文檔下手!

設定伺服器環境

  1. 這邊參考的是官方文檔的建構開發環境
  2. 安裝Node.js,下載對應版本後進行繼續 > 繼續 > 同意 > 安裝 > 等待安裝 > 關閉,基本上就可以安裝完成了~
  3. 開啟cmd並到你想建專案的資料夾,然後執行(這裡是用Expo的方式建,比較快速方便):

    npx create-expo-app AwesomeProject
    

    輸入y同意,即可創建一個名為AwesomeProject的專案。

  4. 建好的資料夾內容會長這樣,若長得不太一樣,可以看看是不是用到了別的語法。

    (如果你不是用Expo的方式建,是用npx react-native@latest init AwesomeProject的方式,則會長下面這樣。)

  5. 進到剛剛的專案。
    cd AwesomeProject
    
  6. 開啟Server來執行。
    npx expo start
    
  7. 成功執行後會出現一個QRCode到這邊伺服器就建立完了~

執行在行動裝置上

  1. 手機進入商店並安裝Expo Go(或叫Expo)。
  2. 將手機與電腦連至同一個Wi-Fi。
  3. 開啟APP點選掃描QRCode,再掃一下剛剛cmd裡出現的QRCode。
  4. 手機上出現這個畫面就是成功啦!

結束伺服器

直接照指示上按ctrl+c就可以囉!


總結

今天已經會使用電腦建立伺服器並使用手機連結來查看結果了,明天開始用它們來試做一些小功能吧!


Github連結

AwesomeProject


#ReactNative #javascript #learning #LPU #groq







Related Posts

 [10] 型別 - 內建型別、基本型別值

[10] 型別 - 內建型別、基本型別值

DAY17:A Needle in the Haystack

DAY17:A Needle in the Haystack

CS50 IP (Internet Protocol)

CS50 IP (Internet Protocol)


Comments