React Redux with TypeScript Crash Course - 2021

Поділитися
Вставка
  • Опубліковано 19 гру 2024

КОМЕНТАРІ • 129

  • @codewar6708
    @codewar6708 Рік тому +1

    on 25:46 you use default Disptach type, which not include thunk type so avoid this using, AppDispatch = typeof store.dispatch.

  • @als5321
    @als5321 3 роки тому +8

    Your channel is a hidden gem. So many cool topics you cover. Don't stop grinding you're gonna blow up.

  • @sujantkumarkv5498
    @sujantkumarkv5498 Рік тому

    The quality is actually so freaking good :)

  • @aeganaden
    @aeganaden 3 роки тому +3

    Man, your channel deserves more subscribers. The level of clarity that you give deserves 10million subscribers. Anyways, I'm so glad that i discovered your channel, will support this channel always!
    Keep up the good work!

  • @diegosk8bt
    @diegosk8bt 3 роки тому

    I came from vue world and I'm able to digest this content really easily, thanks.

  • @itsmiemusic
    @itsmiemusic 3 роки тому +13

    Thank you for you content--your channel's helped me SO much! Easy to follow and understand & very thorough 👏🏼 I've watch this video and the two others you recommended, and I'm blown away by how quickly I'm picking up what you're putting down! You're a great instructor, thanks again!

    • @itsmiemusic
      @itsmiemusic 3 роки тому

      Would you be able to create a crash course on using React Redux Typescript to build an Electron app?

    • @laithacademy
      @laithacademy  3 роки тому +1

      Thanks for the kind comments. Honestly, don't know any Electron, but if I learn it, I'll make a video about it.

  • @boswellorendain3355
    @boswellorendain3355 2 роки тому +1

    Thank you so much transitioning from react js w/ redux to react ts w/ redux had been hard but this video made everything clear. Very well put explaination and easy to understand :D

  • @preciousbey
    @preciousbey 2 роки тому

    29min in and just wow 😲 typescript is a bit tricky. This clears things up

  • @sarcasticdna
    @sarcasticdna 3 роки тому +1

    Woah ❤️ this video is awesome, happy that you didn't start explaining what Redux is in this video again 😄

  • @Balistick51
    @Balistick51 Рік тому

    Amazing guide. Really helpful to understand how redux works with react and typescript. Thank you!

  • @arkmy
    @arkmy 3 роки тому

    The best redux tutorial I have seen (I saw many!). You got a new subscriber.

  • @nnamenearinze6086
    @nnamenearinze6086 2 роки тому

    This was a perfect refresher I wish I could like and sub multiple times. Thank you!!!!

  • @hugo057855555
    @hugo057855555 2 роки тому

    Nice video, now I understand react and redux with typescript

  • @user-ms4cs7vx9t
    @user-ms4cs7vx9t 3 роки тому

    This video helped me complete the test assignment get my first job 😅

  • @svetoslavivanov8871
    @svetoslavivanov8871 2 роки тому

    I just starting learning react and redux. your videos are great!

  • @RampageV1d30s
    @RampageV1d30s 3 роки тому

    Thanks a lot dude! Documentations and articles makes it so complicated but you made it so simple

  • @ankitvasita
    @ankitvasita 3 роки тому +38

    very well explained....please bring one project with react - redux with typescript.

    • @LoveisHell85
      @LoveisHell85 3 роки тому

      Yes, I would love to see this. Would pay money also

  • @Atif1702
    @Atif1702 3 роки тому +18

    You are a mentor to me but just few points:
    1. You don't need types for redux-thunk as Redux Thunk provides its own type definitions.
    2. You can put the interfaces in "__.d.ts" files and you don't have to import or export it then

    • @Anothy
      @Anothy 2 роки тому

      For #2, you can but should you?

    • @Atif1702
      @Atif1702 2 роки тому

      @@Anothy why not?

  • @ahmedkrdzalic4425
    @ahmedkrdzalic4425 3 роки тому +14

    It would help a lot if you give us the GIT repository to have a reference when it comes to bug handling. Or maybe at the end of the tutorial, to show all code in a few seconds so we can see where we have made a mistake. Btw, thank you for this.

  • @spunk707
    @spunk707 3 роки тому

    Thank you very much. First tutorial that actually works, and it was with typescript! very clear explanation of everything...

  • @MrAndykofi
    @MrAndykofi 3 роки тому +1

    Thanks very much, I used this to refresh my react types experience, very clear.

  • @dominiccohen7576
    @dominiccohen7576 2 роки тому +2

    Great tutorial thank you. Only question I have is about using index files for organisation. This is not the place for discussion about best practice naming conventions for Interfaces and their Implementations, or deep concepts of object orientation. Yet someone new to TS concepts may get more benefit if the interfaces were placed in a file named more appropriately, such as accountActionInterfaces or something similar.

  • @ashwinnair9862
    @ashwinnair9862 3 роки тому +2

    Thanks, for this tutrial looking forward to sagas as thunk can be a pain in some situations.

  • @gandalfgrey91
    @gandalfgrey91 2 роки тому +1

    At 34:20 my app failed to launch, I've been following everything exactly up to that point, triple checking all my code with the github repo. I got a a few errors in console "Invalid Hook Call", "Cannot read properties of null (reading 'useMemo')" and "The above error occurred in the component: Provider". Anyone have any clue what issue I'm getting?

  • @arcosd63
    @arcosd63 Рік тому

    Thanks! Pretty good video, I like how you explain the material.

  • @khertgeverola175
    @khertgeverola175 3 роки тому +2

    Good tutorial. I suggest your next tutorial would be react-redux typescript using redux toolkit.

  • @andrewspatrick2452
    @andrewspatrick2452 3 роки тому +8

    if you do a e-commerce project with TS + react + redux would be amazing

    • @gagan987
      @gagan987 Рік тому

      Yes please make a video of it because I'm try to use a action creator inside a action creator but I'm getting errors so please make a video about it.
      To give more detail about my problem I'm trying to build a todo app with redux and typescript so after updating (dispatch(updateTodo())) a todo what i would do without typescript is that i would call getTodos action creator (dispatch(getTodos())) which would fetch all the updated todos but with typescript I'm getting errors

  • @codewithsandip8397
    @codewithsandip8397 2 роки тому

    This is hlp full for begginer Thank You So Much ::))

  • @Julian-oy7dy
    @Julian-oy7dy 3 роки тому

    This lecture helped me a lot. Thank you. I wish there was also a REST service course using TypeScript. This is the function for the client to log in to a specific admin page and modify personal information.

    • @laithacademy
      @laithacademy  3 роки тому +1

      I have a Nest crash course that uses TypeScript to create a REST API

  • @lsowein
    @lsowein 3 роки тому

    Another very useful tutorial.Thank you! You are a great instructor!

  • @romimaximus
    @romimaximus 3 роки тому

    at 20:00, everytime that i install a package, than i have to install this "@types" also....? and does the typecript wesbite has a list of this packages ?.. by the way awesome tutorial, thank you

  • @fatihcamgoz
    @fatihcamgoz 3 роки тому

    Great tutorial! Liked and subbed! (Please do a long video on a big scale project for Redux Typescript)

  • @felipemiguel5581
    @felipemiguel5581 3 роки тому

    Man, Thank you so much. It's so helpful me, Thank for this content.

  • @davidho1258
    @davidho1258 3 роки тому

    you dont need to import from /folder/index.ts. /folder would do. VScode will assume you want to import from the folder's index file
    instead of clicking to autofill imports, you can press tab or enter. You may have to change the settings in your VSCode.
    Add a selector to your store called bankSelector.
    export const bankSelector = (state: State) => state.bank

  • @Quicknuggets
    @Quicknuggets 2 роки тому

    @28:18 Its still not catching the error for bankrupt .. since bankrupt should not have any payload.. how can this be fixed?

  • @shineLouisShine
    @shineLouisShine 11 місяців тому

    Teach me anything!
    ...Although, in this case, at the end of the video
    Some conclusion of the entire structure and flow of the app -
    Wouldn't be a mistake.
    Thanks a lot :)

  • @meliVinelli333
    @meliVinelli333 2 роки тому

    Thanks for the video. Did you ever create a part 2 to this video ? I couldnt seem to find one

  • @learnsmart1812
    @learnsmart1812 3 роки тому

    Serious awesome and I loved way of explanation is good 👏.

  • @jurajdurej
    @jurajdurej 2 роки тому

    awesome video my friend :D thank you

  • @pauljmorton
    @pauljmorton 2 роки тому +3

    So when I do that "npm install" stuff, is it redux-thunk or react-thunk? You say redux-thunk but you typed react-thunk. Your stuff installed fine with react-thunk. My stuff also installed fine even though I went with redux-thunk.

    • @surajnair2617
      @surajnair2617 2 роки тому +1

      react-thunk gave me dependency issues, redux-thunk worked..thanks

  • @marcinbaazy1692
    @marcinbaazy1692 3 роки тому +1

    thanks! but why are you using redux-thunk in all actions? why not just return plain object instead of function with dispatch? is that something related with redux with ts?

    • @137dylan
      @137dylan 3 роки тому

      You are correct there was no need to add the thunk middleware in this tutorial as the actions were synchronous. However the same template/architecture can be used for async calls, such as to an API or if using Firebase etc. (anything with promises)

  • @rodolforaquion166
    @rodolforaquion166 2 роки тому +1

    Just a question because I'm a newbie:
    Is this the traditional way of using react-redux? I've watched Mark Erikson's video about Redux and he's using reduxjs-toolkit. So I'm just curious if I'm following the "modern" way of doing react-redux.
    I've also noticed there are no slices created that's why I wondered.

    • @CapeSkill
      @CapeSkill 2 роки тому +1

      This is a classic implementation of redux, but you can honestly use both. RTK(redux toolkit) eliminates a little bit of the boiler plate, but you can use this type of implementation in modern react applications as well to be honest.

  • @iamaakashbasnet
    @iamaakashbasnet 3 роки тому

    You're a gem 💎! Thanks a lot man! 🤩

  • @MrSociety404
    @MrSociety404 3 роки тому +1

    Wonderful video ! Please can you do a crash course for API framework

    • @laithacademy
      @laithacademy  3 роки тому +1

      Like Express JS?

    • @MrSociety404
      @MrSociety404 3 роки тому

      @@laithacademy yes why not, I don't have any skills in this, I actually use a "API" with a php file to communicate with my database, so I want to learn something new and something good. (Sorry for my English I'm Belgian)

    • @MrSociety404
      @MrSociety404 3 роки тому

      @@laithacademy I'm really interested to meet someone who have skills and who explained well like you, if you can please add me on discord, i'll will be glad, MrSociety404#5268

  • @fares.abuali
    @fares.abuali 2 роки тому

    This video is a treasure 🪙
    Concise and informative.
    Thank you so much.

  • @christahegedus332
    @christahegedus332 2 роки тому

    I can't find the next video when you get this app to work. Can you display a link to it? Thank you.

  • @codelightsparkles2403
    @codelightsparkles2403 2 роки тому

    Thank you for the tutorial! you rock!

  • @garikmelqonyan6011
    @garikmelqonyan6011 2 роки тому

    Many thanks!
    Good tutorial.

  • @MohammadAApu
    @MohammadAApu 2 роки тому

    how to dispatch multiple actions inside action creators in this way? like if I add new item then I would like to sum total (of those items) to a separate property in store)

  • @jaicarey7023
    @jaicarey7023 3 роки тому

    Exceptional video mate! I was struggling with applying typing to redux, this was very helpful :)
    Edit: I will say I personally really dislike calling nearly every file index.ts, very easy to get lost in that kind of environment...
    But I do really like the way you implement redux as hooks? From the course I did I used the connect method and implement map state to props and map dispatch to props.
    I am tossing up which is easier to read.

  • @UwU-dx5hu
    @UwU-dx5hu 6 місяців тому

    you passed an empty object ,{} as the 2nd argument in the createStore() funciton. But is this the right thing to do. When i am coding in javascript i only pass 2 argument to this function. the reducer and the middleware. I never pass 3. so why do i have to pass this extra {} when i code in typescript??

  • @clrbrk9108
    @clrbrk9108 3 роки тому +1

    This is a great video and I learned a ton, but a fair warning to viewers: this is NOT modern Redux implementation. Which I learned the hard way during a code test written with modern Redux implementation :(

  • @dylanstandridge3201
    @dylanstandridge3201 2 роки тому

    Would you recommend passing your dispatch down into your components whenever your setting up your app with someone like react router dom?

  • @igdev6095
    @igdev6095 3 роки тому +1

    Redux - axios - typescript, I hopefully you will do that! Thanks before

  • @jeffgasparini5927
    @jeffgasparini5927 3 роки тому

    Hello, sorry for my english, im french developer, very good tutorial ! ty

    • @bloodzz4813
      @bloodzz4813 3 роки тому

      Don't worry ur English is good

  • @EverAfterBreak2
    @EverAfterBreak2 3 роки тому +1

    Algo comment, i'll watch later

  • @andrzejsotnikow7494
    @andrzejsotnikow7494 3 роки тому

    Thank you for this tut!

  • @xaxaFilms
    @xaxaFilms 3 роки тому

    very informative. thank you!

  • @gozhira9520
    @gozhira9520 3 роки тому

    Awesome! Thank you for sharing, very useful, I only have one question, if i have more than one reducer what would be the file organization? Thanks.

    • @137dylan
      @137dylan 3 роки тому

      You'd do the same thing and then import all reducers to the root reducer file where they're combined. Or you would use Redux Toolkit which solves this multiple reducer problem by creating "slices"

  • @ameerhamza-pw1vq
    @ameerhamza-pw1vq 3 роки тому +2

    good explanation

  • @TheYinyangman
    @TheYinyangman 2 роки тому +3

    createStore is deprecated for learning purposes use import { legacy_createStore as createStore } from "redux";

  • @daakuish
    @daakuish 2 роки тому

    What if we want to export the actions constants as "export const DEPOSIT = 'deposit'" *instead of enum* and use as
    interface DepositAction {
    type: DEPOSIT,
    payload: number
    }
    If I do this, I get the error " 'DEPOSIT' refers to a value, but is being used as a type here".

  • @surveillancecameratada63
    @surveillancecameratada63 3 роки тому

    hmm ... (src/state/reducers/bankReducer.ts)
    ...
    default: // slove Error: The slice reducer for key "bank" returned undefined during initialization.
    return state

  • @mohammedjamal4759
    @mohammedjamal4759 3 роки тому

    Thank you so much for this course, Can you please Make a new Redux with Typescript for eCommerce store?

  • @mashoodkiyani3992
    @mashoodkiyani3992 3 роки тому

    that is just beautiful

  • @SamyarBorder
    @SamyarBorder 2 роки тому

    This video is great ... 😀😀

  • @Devilman91
    @Devilman91 2 роки тому

    Hello, course is awesome but can you show or explain how to dispatch single action without bindActionCreators? In practice, in real projects dispatch is used by many components. thanks

  • @IkraamDev
    @IkraamDev 3 роки тому

    Thank you ليث حرب

  • @TheMakeupmonika
    @TheMakeupmonika 3 роки тому

    l love your content !!! keep on going , please ...

  • @monkeystylle
    @monkeystylle 3 роки тому

    thanks for the tutorial. can you make Redux saga..

  • @OSCAR-CH
    @OSCAR-CH 3 роки тому

    Hey thanks a lot bro. What pattern are we using here with action-types, actions and reducers folders?

  • @tarekhammami2350
    @tarekhammami2350 3 роки тому

    Thank you very much for this video !
    But, unfortunatly, I have a problem running Redux DevTools Chrome extension with this setup.
    Can anyone please suggest a solution ?

    • @abdelnacerr
      @abdelnacerr 3 роки тому

      This works for me:
      import {compose} from "redux"
      compose(
      (window as any).__REDUX_DEVTOOLS_EXTENSION__ && (window as any).__REDUX_DEVTOOLS_EXTENSION__()
      )

  • @skydivey
    @skydivey 3 роки тому

    Great explanation.

  • @haroldmaussa
    @haroldmaussa 3 роки тому +1

    hi, please the repository

  • @sohailhaqyar3949
    @sohailhaqyar3949 3 роки тому

    Good stuff man.

  • @saisashankchavaly2121
    @saisashankchavaly2121 3 роки тому

    is there any git repo for this?

  • @baiweichen7521
    @baiweichen7521 3 роки тому

    learn a lot. thank you.

  • @Gigglezonee
    @Gigglezonee 2 роки тому

    I have setup the redux by watching your video.. Could please tell where i should make api call.. I tried and made api call in action creator.. But in response i get function.. () {return dispatch (actionCreator.apply(this.arguments)) }
    Can provide a suggestion on how to make api and get response using redux with typescript:)

  • @anabuch5986
    @anabuch5986 3 роки тому

    Thank for your video.
    I am having a compile error at "export * as actionCreators from './action-creators/index';"
    It seems to be a bug. I don't find the solution.
    The error is the following:
    You may need an additional loader to handle the result of these loaders

  • @designcoderdev3080
    @designcoderdev3080 3 роки тому

    can you make nuxt ts vuex vue 3?

  • @ddikodroid
    @ddikodroid 3 роки тому

    redux toolkit and react query with typescript(?)

  • @RAJUBHAI-ww7em
    @RAJUBHAI-ww7em Рік тому

    laith you thanks a lot mate

  • @captainprogramming
    @captainprogramming Рік тому

    Thanks for making video

  • @DeepakGupta-pz4fx
    @DeepakGupta-pz4fx 2 роки тому

    Can you make one video redux saga

  • @korndev6862
    @korndev6862 2 роки тому

    great tutorial

  • @mariorios8827
    @mariorios8827 3 роки тому

    Nice!! Thank you

  • @user-oh4xi2xb2d
    @user-oh4xi2xb2d 3 роки тому

    will be great to know how to add redux dev tool

  • @vermusl6316
    @vermusl6316 3 роки тому

    why not redux toolkit tho ?

  • @macos-brasil1814
    @macos-brasil1814 3 роки тому

    great but sometimes (unless is a biiiiig project with many people on the team) its just too much creating functions to check the type of the type of the type of the type of the checker function that check the other functions which will check if you misstype "order" in the parameters.

  • @RavindraSingh-lp9pl
    @RavindraSingh-lp9pl Рік тому

    great video..

  • @ol1175
    @ol1175 2 роки тому

    Best one!!!

  • @anishchaudhary313
    @anishchaudhary313 2 роки тому

    createStore is not working

    • @ImLaminarBro
      @ImLaminarBro 2 роки тому

      I had to import as legacy_createStore since createStore is deprecated. Someone said to learn redux without toolkit but man, its kind of a pain in the ass lmao

  • @mmacuts7527
    @mmacuts7527 3 роки тому

    Thanks for this

  • @hasancheraghi2800
    @hasancheraghi2800 3 роки тому

    Hey. thank u so much

  • @028-manikandan3
    @028-manikandan3 Рік тому

    You put reactnative with typescript projects more 🙏🙏🙏🙏

  • @bluediu1714
    @bluediu1714 3 роки тому

    Thank you :)

  • @amjadshadid90
    @amjadshadid90 3 роки тому

    thanks a lot

  • @lilitgrigoryan6020
    @lilitgrigoryan6020 2 роки тому

    I didnt see you are using typescript anymore...

  • @dennisgonzales9521
    @dennisgonzales9521 3 роки тому

    thanks!!

  • @ZeeshanAli-kc3zc
    @ZeeshanAli-kc3zc 3 роки тому

    way underrated video