Live refactoring a subscribers React SPA anime application

Поделиться
HTML-код
  • Опубликовано: 31 дек 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!

  • @Manjaco
    @Manjaco 2 года назад +1

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

  • @afaque.
    @afaque. 2 года назад +2

    At last someone experienced making a video

  • @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

  • @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

  • @bluerose2542
    @bluerose2542 2 года назад

    5:00 What if we have a nested route?

  • @AnshumanKP
    @AnshumanKP 2 года назад

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

  • @ishakzehhaf864
    @ishakzehhaf864 2 года назад

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

  • @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.

  • @qutibcodder
    @qutibcodder 2 года назад

    Great video bro!

  • @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.

  • @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

  • @jordondax
    @jordondax 2 года назад

    Great video idea man, learning a ton.

  • @ГенаПетров-н5ы
    @ГенаПетров-н5ы 2 года назад +2

    export page slug from page component

  • @skeetplayz
    @skeetplayz 2 года назад

    Which VScode theme are you using?

  • @markangeloatienza7405
    @markangeloatienza7405 2 года назад +1

    Love to watch more of this kind of videos.

  • @HarshPatel-uz4nm
    @HarshPatel-uz4nm 2 года назад

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

  • @gusde9681
    @gusde9681 2 года назад

    what vscode theme did u use in this video?

  • @NguyenLam-vz9nb
    @NguyenLam-vz9nb 2 года назад +1

    Very useful hope you make more videos like this

  • @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.

  • @omerfarooq7752
    @omerfarooq7752 2 года назад +2

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

  • @mmareplays4610
    @mmareplays4610 2 года назад

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

  • @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!

  • @markangeloatienza7405
    @markangeloatienza7405 2 года назад

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

  • @ninjaplavi
    @ninjaplavi 2 года назад

    How can we submit apps for these refactoring videos?

  • @_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.

  • @SeibertSwirl
    @SeibertSwirl 2 года назад +2

    Good job babe!!!!!

  • @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

  • @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

  • @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.

  • @ProbablyArth
    @ProbablyArth 2 года назад

    I love to watch videos like these

  • @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.

  • @李鴻均-y6i
    @李鴻均-y6i Год назад

    Thanks!

  • @xiiEJRAM
    @xiiEJRAM 2 года назад

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

  • @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

  • @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 😅

  • @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?