Cov txheej txheem:

Kuv yuav tsim ib qhov project hauv react redux li cas?
Kuv yuav tsim ib qhov project hauv react redux li cas?

Video: Kuv yuav tsim ib qhov project hauv react redux li cas?

Video: Kuv yuav tsim ib qhov project hauv react redux li cas?
Video: Tsis Deev Koj Thiaj Tsis Seev BY Aka 2024, Hlis ntuj nqeg
Anonim

Rau tsim ib new qhov project , cia li prepend npx ua ntej tsim - teb -app redux -cra. Qhov no installs tsim - teb -app thoob ntiaj teb (yog tias nws tsis tau teeb tsa) thiab tseem tsim ib qho tshiab qhov project.

Redux Khw

  1. Tuav lub xeev daim ntawv thov.
  2. Tso cai nkag mus rau lub xeev ntawm getState().
  3. Tso cai rau lub xeev hloov tshiab ntawm kev xa tawm (kev nqis tes ua).

Hais txog qhov no, kuv yuav ntxiv Redux li cas rau qhov project react?

Step-by-Step: Yuav Ua Li Cas Ntxiv Redux rau React App

  1. Kauj ruam 1: Ntshuam Redux NPM pob.
  2. Kauj ruam 2: Tsim ib tug Reducer.
  3. Kauj ruam 2: Tsim ib lub khw Redux.
  4. Kauj ruam 3: qhwv lub Main App Cheebtsam nrog tus kws kho mob.
  5. Kauj ruam 4: Tsim thiab txuas lub thawv ntim khoom.
  6. Kauj ruam 5: Xaiv thiab Hloov Lub Xeev los ntawm Redux Store.
  7. Kauj Ruam 6: Siv Lub Xeev hauv Cov Txheej Txheem Tshaj Tawm.

Tsis tas li ntawd, koj yuav ua li cas thiaj tsim tau ib qho app rau kev ua haujlwm? Cov kauj ruam no yuav ua haujlwm rau ib qho React app tsim nrog tsim-react-app.

  1. Kauj ruam 1: Tsim React App.
  2. Kauj ruam 2: Ntxiv koj tus kheej app icon rau Public folder.
  3. Kauj Ruam 3: Tsim ib qho Express JS server los pab koj tsim cov khoom tsim.
  4. Kauj ruam 4: Tsim React ntau lawm tsim.
  5. Kauj ruam 5: Tiv thaiv qhov chaws los ntawm deployed.

Kuj kom paub yog, koj pib qhov project react li cas?

Kev teeb tsa React Project

  1. Kauj ruam 1: Nruab Daim Ntawv Thov Qauv. Clone lub es6-tutorial-react repository: git clone
  2. Kauj ruam 2: Teeb Babel thiab Webpack. Qhib cov lus hais kom sai, thiab taw qhia (cd) mus rau es6-tutorial-react directory.
  3. Kauj ruam 3: Tsim thiab khiav.

Kuv yuav siv React Redux app li cas?

Pib pib

  1. Tsim ib qho App. Txhawm rau tsim ib lub app tshiab, khiav: tsim-react-redux-app-structure my-app cd my-app /
  2. Npaj config. json rau tsim configurations.
  3. Kev teeb tsa. npm install or yarn install.
  4. Khiav tsim ntawv. Saib ntawm Build Scripts section.
  5. Khiav server. node index.js lossis npm khiav server.

Pom zoo: