Live refactoring a subscribers React SPA anime application

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 พ.ย. 2024

ความคิดเห็น • 63

  • @arditgashi8850
    @arditgashi8850 2 ปีที่แล้ว +12

    Stop excusing yourself for doing what you are doing. You are doing great, everything you've done in this refactor I would have done myself. Don't be so hard on yourself. Great video, keep them coming!

    • @WebDevCody
      @WebDevCody  2 ปีที่แล้ว +3

      I often self doubt my abilities, but yes I agree, I need to just own it

  • @Sapphiamur
    @Sapphiamur 2 ปีที่แล้ว +1

    These refactoring sessions are awesome to learn from, thank you so much!

  • @vaibhavgautam1999
    @vaibhavgautam1999 2 ปีที่แล้ว +4

    This is really helpful for new programmers like me, it feels like a PR review. And lots of new insights

    • @Nodsaibot
      @Nodsaibot 2 ปีที่แล้ว

      most of his fixes is stuff hes breaking lol

    • @vaibhavgautam1999
      @vaibhavgautam1999 2 ปีที่แล้ว

      @@Nodsaibot doesn't matter for anyone is getting any value out of it

  • @ishakzehhaf864
    @ishakzehhaf864 ปีที่แล้ว

    Dammmnn bro, you always make very helpful videos about coding and way of working. Keep up

  • @afaque.
    @afaque. 2 ปีที่แล้ว +2

    At last someone experienced making a video

  • @AnshumanKP
    @AnshumanKP 2 ปีที่แล้ว

    Your videos are chill and informative, specially the live code refactoring streams. Love them!

  • @3dninja54
    @3dninja54 2 ปีที่แล้ว +9

    One thing I would say is to use lowercased words separated by hyphens for css classes. So instead of heroContainer, make it hero-container.

    • @saitech2452
      @saitech2452 2 ปีที่แล้ว

      that doesnt work with react if they use module any idea how would you deal with that?

    • @madtin
      @madtin 2 ปีที่แล้ว +2

      @@saitech2452 you would have use it like styles['hero-container'] in the jsx but It's pretty uggly so I prefer to use camelCase.

    • @saitech2452
      @saitech2452 2 ปีที่แล้ว

      @@madtin ye same I just use camel case I'm still looking for improvements but so far nothing found

  • @Manjaco
    @Manjaco 2 ปีที่แล้ว +1

    I believe the problem was the missing “:” at 6:37 before the ${id}

  • @qutibcodder
    @qutibcodder ปีที่แล้ว

    Great video bro!

  • @NguyenLam-vz9nb
    @NguyenLam-vz9nb 2 ปีที่แล้ว +1

    Very useful hope you make more videos like this

  • @jordondax
    @jordondax 2 ปีที่แล้ว

    Great video idea man, learning a ton.

  • @markangeloatienza7405
    @markangeloatienza7405 2 ปีที่แล้ว +1

    Love to watch more of this kind of videos.

  • @BSimone95
    @BSimone95 2 ปีที่แล้ว

    Love this type of content. I'm worse than you at coding, the only thing that came to my mind while you were refactoring is that it seemed that the random anime page was returning JSON detials for all the animes, which made the call to get the data again for individual anime seem a bit redundant. I think, in a perfect world, when opening the individual component I would've had something like an optional prop with data if I'm coming from the random anime page, if there is no prop then I make the request with the id.

  • @turkeymoonrover6830
    @turkeymoonrover6830 2 ปีที่แล้ว +3

    React-router has GeneratePath method for generating paths with params . Better approach then GOTO usage.

    • @WebDevCody
      @WebDevCody  2 ปีที่แล้ว +2

      Illl need to check that out thanks for sharing

  • @stanimirdimitrov4913
    @stanimirdimitrov4913 2 ปีที่แล้ว +6

    4:56 - I'd say, make an array of objects, which would include the path and the element that you want to render. Then, you would simply map it in the return statement.

    • @stanimirdimitrov4913
      @stanimirdimitrov4913 2 ปีที่แล้ว

      Love your content @Web Dev Junkie. I am a junior developer and most of the things that you say actually help me get better. Thank you!

    • @rmt0858
      @rmt0858 2 ปีที่แล้ว +1

      I think mapping would take much time.

  • @bluerose2542
    @bluerose2542 2 ปีที่แล้ว

    5:00 What if we have a nested route?

  • @skeetplayz
    @skeetplayz 2 ปีที่แล้ว

    Which VScode theme are you using?

  • @SeibertSwirl
    @SeibertSwirl 2 ปีที่แล้ว +2

    Good job babe!!!!!

  • @HarshPatel-uz4nm
    @HarshPatel-uz4nm 2 ปีที่แล้ว

    What Xcode theme, with font and text color scheme are you using

  • @ProbablyArth
    @ProbablyArth 2 ปีที่แล้ว

    I love to watch videos like these

  • @李鴻均-y6i
    @李鴻均-y6i ปีที่แล้ว

    Thanks!

  • @lalithrockz
    @lalithrockz 2 ปีที่แล้ว

    Ive been having this bug when I login it goes into a infinite loop. It should go to a home page but its not. If I manually go to the other routes then the whole app works fine.

  • @xiiEJRAM
    @xiiEJRAM 2 ปีที่แล้ว

    I really love watch your videos and the way you think 🖤

  • @mmareplays4610
    @mmareplays4610 2 ปีที่แล้ว

    Nice video man. What extension shows the errors while you code?

  • @ESArnau
    @ESArnau 2 ปีที่แล้ว

    What is better to render if u wanna display nothing. A react fragment or null?

    • @foxyl0l
      @foxyl0l 2 ปีที่แล้ว

      the answer within the question

  • @raygo44
    @raygo44 2 ปีที่แล้ว

    There is a card component which has 4 props being passed into it. What I would do is to pass only one prop to it called "anime" and destructure what I need inside the component. Tho the reasoning behind different props is probably because there is a lot of data inside "anime" object which makes it pointless to pass entire anime object, but if that wasn't the case I would pass only 1 prop and destructure.

    • @WebDevCody
      @WebDevCody  2 ปีที่แล้ว +1

      that works as well, one issue I have with that is if you anime card only need to display 4 things, but your Anime object has 30 properties, you don't want to expose all that extra data to your card object since that increases coupling between your anime object and UI card component.

    • @raygo44
      @raygo44 2 ปีที่แล้ว

      @@WebDevCody Yeah I agree. That is basically what I said.

    • @WebDevCody
      @WebDevCody  2 ปีที่แล้ว +1

      @@raygo44 nice ok we’re on the same page!

  • @omerfarooq7752
    @omerfarooq7752 2 ปีที่แล้ว +2

    You can also set the base_url on axios instance itself by doing something like axios.defaults.baseURL = "YOUR_URL"';

  • @_Rohit_Kumaar
    @_Rohit_Kumaar 2 ปีที่แล้ว

    How you directly importing anything by pressing some key in vs code ? please share

    • @yaseru
      @yaseru 2 ปีที่แล้ว +1

      install auto import extension on vscode, when you type something it autocompletes for you and then autoimports it.

  • @ninjaplavi
    @ninjaplavi 2 ปีที่แล้ว

    How can we submit apps for these refactoring videos?

  • @christianwebb4748
    @christianwebb4748 2 ปีที่แล้ว

    Maybe have 1 function for getAnimes/getAnime? Return all data if id is undefined?

    • @WebDevCody
      @WebDevCody  2 ปีที่แล้ว

      That’s an option for sure

  • @markangeloatienza7405
    @markangeloatienza7405 2 ปีที่แล้ว

    What vscode extension you are using to show live errors on set of coding ? thank you in advance!

  • @gusde9681
    @gusde9681 2 ปีที่แล้ว

    what vscode theme did u use in this video?

  • @vintage8
    @vintage8 2 ปีที่แล้ว

    Could you share the extensions you use for React?
    Thanks

    • @vintage8
      @vintage8 2 ปีที่แล้ว

      Did you heart my question without answering it? That's odd, no?

    • @fadoashura2867
      @fadoashura2867 2 ปีที่แล้ว

      @@vintage8 I laughed.

  • @ГенаПетров-н5ы
    @ГенаПетров-н5ы 2 ปีที่แล้ว +2

    export page slug from page component

  • @RaldinCasidar
    @RaldinCasidar 2 ปีที่แล้ว +1

    The routing approach just makes it more complicated. But other than that, this is cool!

    • @WebDevCody
      @WebDevCody  2 ปีที่แล้ว

      I would agree for this example, but on an application with 30 different endpoints, it makes it hard to refactor a url if everything is hard coded to point to that url, but yes maybe this approach isn’t the best 😅

  • @sammorgan7143
    @sammorgan7143 2 ปีที่แล้ว

    Warning: Hypthons in URLs are frowned upon in SEO
    Edit: ignore the above, it's only for domain names, rather than URLs.

    • @WebDevCody
      @WebDevCody  2 ปีที่แล้ว +1

      The first google result says google recommends using hyphens since they are more human readable

    • @sammorgan7143
      @sammorgan7143 2 ปีที่แล้ว

      @@WebDevCody ammended as it's only relevant for domain names.

  • @elmalleable
    @elmalleable 2 ปีที่แล้ว

    if you dont have typescript in a project then you can use jsdoc comments to annotate the code and get better intellisense support, also add jsconfig to the project to get vscode to provide even better guard rails. to get jsconfing with little effort , try `npx jsconfig.json`, then confirm checkJS is true, you could also set that in vscode itself somewhere

  • @ThePirateHistory
    @ThePirateHistory 2 ปีที่แล้ว

    For me, it’s better to come up with criteria for selecting projects, because this project in the video is full of ***, for example, the url should go through -, then don’t use the id, use the slug, because there weren’t such stupid movements as downloading absolutely all things that are not displayed, otherwise you will drown in shit, and you will constantly be asked to help and help. The type from the video needs to take some kind of course for beginners, where they will explain what to do, what to think, what to optimize, think about traffic, etc.

    • @WebDevCody
      @WebDevCody  2 ปีที่แล้ว +1

      I didn’t really understand what you’re ranting about to be honest. Are you insulting my subscribers code because he is a beginner?