Redux DevTools
Redux DevTools kayan aiki ne na burauza extension wanda ke taimaka muku waƙa da cire kuskure Redux Store cikin sauƙi. Yana ba da hanyar dubawa don duba tarihin actions da jihohi, haka kuma yana ba ku damar kewayawa da ganin canje-canje a cikin Redux Store lokaci. Wannan yana taimaka muku fahimtar yadda yanayin aikace-aikacen ke canzawa idan actions ya faru.
Don haɗawa Redux DevTools cikin Next.js aikace-aikacen, zaku iya amfani da redux-devtools-extension
ɗakin karatu. Ga misalin yadda ake haɗa shi:
Shigar Redux DevTools Extension:
Yi amfani Redux DevTools Extension lokacin ƙirƙirar Redux Store:
Lokacin da ka buɗe Redux DevTools a cikin burauzarka, za ka ga sabon shafin don bin yanayin jihar da actions na Redux Store.
Lokacin Tafiya Redux
Balaguron lokaci a cikin Redux yana nufin ikon kewayawa baya da gaba tsakanin jihohin don Redux Store bin sauye-sauye a cikin jihar ta hanyar actions. Lokacin da aka haɗa shi da Redux DevTools, tafiye-tafiyen lokaci yana ba ku damar lura da yadda Redux Store jihar ke canzawa akan lokaci.
Advanced Routing and Redux Integration in Next.js
Don haɗa ci gaba routing da Redux ciki Next.js, kuna iya bin waɗannan matakan:
Shigar react-router-dom
da redux-thunk
dakunan karatu :
Ƙirƙiri Redux Thunk Middleware kuma Ƙirƙiri Actions tare da Amfanin Async :
karanta Reducers kuma Routing Data :
Ƙirƙiri Router da Amfani Redux a cikin Next.js Shafi :
Amfani Router da kuma Redux a cikin Next.js Page :
Lura cewa wannan misali ne mai sauƙi na yadda ake haɗawa Redux da routing cikin Next.js. A cikin aikace-aikacen duniyar gaske, ƙila kuna buƙatar yin la'akari da keɓance ƙarin don biyan takamaiman buƙatun aikin ku.