Idan kun yi amfani da npm don sarrafa ayyukan React ษinku, kuma kuna gudanar da npm update react, to React zai zazzagewa ta atomatik kuma shigar da kowane sabon sabuntawa don React. Wannan na iya haifar da matsaloli idan kana amfani da sigar React wanda ba ya dace da sabuwar sigar npm a halin yanzu.
Idan kana amfani da sigar React wanda a halin yanzu bai dace da sabuwar sigar npm ba, to npm sabunta amsa zai zazzagewa ta atomatik kuma shigar da kowane sabon sabuntawa don React. Wannan na iya haifar da matsaloli idan kana amfani da sigar React wanda ba ya dace da sabuwar sigar npm a halin yanzu. Misali, idan kana amfani da sigar React wanda aka saki a watan Disamba 2017, to npm update react na iya shigar da sabuntawa zuwa React wanda aka saki a watan Fabrairu 2018. Wannan zai haifar da matsaloli saboda aikinku ba zai ฦara dacewa da sabuwar sigar Node.js da masu bincike.
Idan kuna amfani da sabon sigar React fiye da abin da aka shigar a halin yanzu akan injin ku, to sabunta aikin ku na iya haifar da matsala. Misali, idan kuna amfani da sigar React wanda aka saki a watan Disamba 2017, kuma aikinku yana amfani da yarn ฦara rubutun amsa-save , sannan kunna sabunta yarn amsa zai kuma shigar da sabon sabuntawa zuwa React. Koyaya, wannan kuma zai sake rubuta kowane canje-canjen lambar da kuka yi ga aikinku tun shigar da sabuntawar da ta gabata zuwa React. Idan wannan wani abu ne da kuke son yin akai-akai (misali, don ci gaba da sauye-sauye a cikin yanayin muhalli), to yana iya zama mafi kyau a yi amfani da wani kayan aiki kamar Git ko SVN maimakon dogaro da npm don sarrafa ayyukan ku.
-router-dom This will update the react-router-dom package to the latest version.
Menene npm
Npm mai sarrafa fakiti ne na JavaScript wanda ke ba ku damar shigarwa da sarrafa fakitin lamba. Ana amfani dashi a cikin React don sarrafa abubuwan dogaro.
Abin da manajan kunshin yake yi
Manajan fakiti kayan aikin software ne wanda ke taimakawa sarrafa shigarwa da sabuntawa na fakitin software akan kwamfuta. Yana ba masu amfani damar bincika, shigar, da cire fakitin software daga tsarin su.
Tips don npm
Akwai ฦดan abubuwan da za ku tuna yayin amfani da npm a cikin React.
Da farko, tabbatar cewa an shigar da sabon sigar npm. Ana iya yin hakan ta hanyar gudanar da umarni mai zuwa:
npm shigar -g npm
Na biyu, tabbatar da cewa kun shigar da kunshin rubutun amsawa. Ana iya yin hakan ta hanyar gudanar da umarni mai zuwa:
npm shigar -g react-scripts
Na uku, tabbatar da cewa kun daidaita canjin yanayin PATH ษin ku ta yadda npm za ta sami abin dogaro na aikin ku. Ana iya yin hakan ta hanyar gudanar da umarni mai zuwa:
Yadda ake sabuntawa a cikin React
Native
React Native dandamali ne na haษaka ฦa'idodin hannu wanda ke ba ku damar gina ฦa'idodin asali ta amfani da React. Don sabuntawa a cikin React Native, bi waษannan matakan:
1. Bude aikin ku a cikin React Native kuma danna kan "React" tab a saman.
2. Danna kan "Update Project" a cikin kayan aiki.
3. A cikin maganganun โSelect a Versionโ, zaษi sabon sigar React Native kuma danna kan โUpdate Project.โ