Single Responsibility Principle in React (Design Patterns)

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ม.ค. 2024
  • Join The Discord! → discord.cosdensolutions.io
    VSCode Theme | Font → Material Theme Darker | Menlo, Monaco "monospace"
    In this video, we talk about the Single Responsibility Principle in React. The Single Responsibility Principle (SRP), is one of the foundational concepts of the SOLID principles. SRP in React means that every component should only have one responsibility and focus on that, while delegating everything else to other components or hooks. In this video, I will show you how to apply the Single Responsibility Principle design pattern in React.

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

  • @ayberk272
    @ayberk272 5 หลายเดือนก่อน +73

    I don't know if this kind of content is actually boring to others but I must say this kinda stuff is what actually helps you become a "good" developer. I can't even stretch the importance of these kind of contents enough. I appreciate the effort, keep it up!

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +11

      That's what my content is for! Glad you enjoy it! 🤙

    • @ardianhotii
      @ardianhotii 5 หลายเดือนก่อน +3

      Excatly , I think this too . This is the best react app architecture in my opinion , keep it up!

    • @ositaka
      @ositaka 5 หลายเดือนก่อน +1

      This is the kind of video you don't find on a react course 🎉

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +2

      I'm actually making a React course that will have much more of this and in much greater detail and scope, stay tuned!

    • @binayakpurohit
      @binayakpurohit 5 หลายเดือนก่อน

      Hie, can anyone here explain me will it be a good practice to create do many files for one component rendering.
      i started react a few months ago and now i have a huge project which has 25+ pages. pages become messy and i sm planning to remove the uglyness, can anyone suggest me the best way for it

  • @riseonelimit
    @riseonelimit 5 หลายเดือนก่อน +21

    There are so many React Tutorials out there but no one shows how to structure the components, Thanks for the great content pal!

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน

      will make many more videos for sure. Also working on a full React course that goes way beyond what my videos do, so stay tuned 🤙

  • @sachintharuka6154
    @sachintharuka6154 5 หลายเดือนก่อน +5

    Because of ur videos my react project code gets better, keep making more videos, so helpful ❤

  • @JR-hb6jr
    @JR-hb6jr 5 หลายเดือนก่อน +1

    Moving the useQuery to new file made a huge difference for me. Thank you very much for these kind of video. Really helpful.

  • @JosephDicdican
    @JosephDicdican 3 หลายเดือนก่อน +1

    💯% helpful, been using react for more than 2 yrs but this makes a lot easier. i'm gonna follow this in our projects. Thx for great tutorial.

  • @moatazali1462
    @moatazali1462 24 วันที่ผ่านมา

    Although I've only been following you for a short time, I find what you do amazing. I love the way you explain things so clearly. You are truly great. Thank you!

  • @moonshadowwlb
    @moonshadowwlb 5 หลายเดือนก่อน

    I had a light idea of what this was but this video took it to the next level, thanks a lot

  • @JohnBuildWebsites
    @JohnBuildWebsites 5 หลายเดือนก่อน +2

    I wish more of my colleagues (and TH-camrs making tutorials) did this. It always makes it so much easier to work with for me.
    One issue that I do sometime face doing this though, is with forms etc where a ref is required. Would be useful to have a part 2 that covers these more complex scenarios

  • @martapfahl940
    @martapfahl940 5 หลายเดือนก่อน +2

    This channel is amazing, thank you!

  • @lexsemenenko7044
    @lexsemenenko7044 4 หลายเดือนก่อน +1

    I am here for these kinds of videos. Anything that helps apps scale. Really appreciated. In my scenario example product card may look different in different site areas, so I create extra component props launch as inHeader, in body, inBodyBtm and than render there any additional components I may need to show up an my parent component

    • @cosdensolutions
      @cosdensolutions  4 หลายเดือนก่อน +2

      I would instead make product card a compound component, and let the parent plug and play the elements it wants in whatever order. Passing props around works, but doesn't scale well at all!

  • @anonysmooth648
    @anonysmooth648 5 หลายเดือนก่อน +1

    never fail to amaze me, thank you for this tutorial

  • @AndreasFroyland
    @AndreasFroyland 5 หลายเดือนก่อน

    Thank you for yet another great video. Really grateful for your content

  • @ekchills6948
    @ekchills6948 5 หลายเดือนก่อน +2

    Very detailed explanation sir. I learned alot. I would start implementing custom hooks more in my applications to separate too much logic from my components

  • @ddorabang
    @ddorabang 5 หลายเดือนก่อน

    어느정도 이해가 됐습니다. 코드가 아주 간결해지네요. 헤메지 않도록 파일 이름을 잘 작성해야겠어요

  • @felipecabreira4321
    @felipecabreira4321 5 หลายเดือนก่อน

    Amazing video as always dude ! keep going :))) helping me alot

  • @abdal-fadeelhamdyabdal-fad1649
    @abdal-fadeelhamdyabdal-fad1649 5 หลายเดือนก่อน

    Great explanation this series of design patterns will be great

  • @mikevillarreal8291
    @mikevillarreal8291 5 หลายเดือนก่อน +1

    Dude, you are doing quite an excellent work with React.
    You remind me of what ArjanCodes does for python.

  • @stepanostapuk4120
    @stepanostapuk4120 5 หลายเดือนก่อน +7

    I think we have to keep in mind that it is important to keep balance between KISS and Single responsibility principle

  • @josuepimentel2488
    @josuepimentel2488 2 หลายเดือนก่อน

    very clear and precise, well done buddy, thanks and keep it up. Suscribed!

  • @plfmoura
    @plfmoura 5 หลายเดือนก่อน +1

    Awesome solution!

  • @tamaniphiri
    @tamaniphiri 5 หลายเดือนก่อน

    Clean code, amazing🚀💯

  • @ImranKhan-be8tp
    @ImranKhan-be8tp 4 หลายเดือนก่อน

    very well explained. awesome

  • @IveSpentMonthsPreparingForThis
    @IveSpentMonthsPreparingForThis 3 หลายเดือนก่อน

    In addition to styling reasons mentioned by Darius, the at 14:44 is also necessary to render the ProductList component in the event that the products array is empty. Otherwise if the array was empty, you'd get an error because the .tsx file isn't returning a component to render.

  • @TechSpot56
    @TechSpot56 5 หลายเดือนก่อน

    Really helpful content. Keep it up.❤

  • @imamdroubi6537
    @imamdroubi6537 5 หลายเดือนก่อน

    This channel is a treasure, too bad I didn't find it long ago.
    Thank you for the amazing content.

  • @NewtonJR1987
    @NewtonJR1987 5 หลายเดือนก่อน

    Amazing content, thank you so much!

  • @wagnerfillio1031
    @wagnerfillio1031 5 หลายเดือนก่อน +1

    All the examples we see talk about the list. It would be nice, an example of creating, editing and deleting, along with the save method, using SRP

  • @Unlimited_Codes
    @Unlimited_Codes 5 หลายเดือนก่อน

    Finally, keep going in this tutorial to complete all solid principles using react.js with typescript

  • @nawazishali274
    @nawazishali274 5 หลายเดือนก่อน

    Nice content and topic to learn ❤

  • @davidhusted817
    @davidhusted817 5 หลายเดือนก่อน

    Thanks so much for the explanation Sir

  • @madehayoussof
    @madehayoussof 3 หลายเดือนก่อน

    Thanks your effort!

  • @shakapaker
    @shakapaker 5 หลายเดือนก่อน +1

    great content!

  • @redwansikder3847
    @redwansikder3847 5 หลายเดือนก่อน

    Thank you for this video.

  • @jeffwallsinger6411
    @jeffwallsinger6411 5 หลายเดือนก่อน

    Very well done

  • @BarakerZeonlist
    @BarakerZeonlist 4 หลายเดือนก่อน

    very clean

  • @joeljorge7339
    @joeljorge7339 5 หลายเดือนก่อน

    Great tutorial

  • @dimitridoroshko
    @dimitridoroshko 5 หลายเดือนก่อน

    Thanks, man. Want more videos of design patterns in react 😊

  • @gmjitendra
    @gmjitendra 5 หลายเดือนก่อน

    Excellent. thanks

  • @harag9
    @harag9 5 หลายเดือนก่อน

    Thanks for that, just wish all applications was that simple. the one I just took over at work is a nightmare... looks nothing like yours :) Keep up the excellent work!

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      I know the feeling, I also had to to take over a really bad application once, but slowly we made it look more like this

  • @desentralizandolared9239
    @desentralizandolared9239 4 หลายเดือนก่อน

    Amazing, thanks 👍🏽👍🏽⚡⚡⚡⚡

  • @Spkntei
    @Spkntei 5 หลายเดือนก่อน

    hank you for this video

  • @evandroteixeira5788
    @evandroteixeira5788 5 หลายเดือนก่อน

    SRP is only the first step down the road, if you want to become a better developer it's completely worth it to take some time to learn all the principles of SOLID and understand how to apply it efficiently into your projects. Great job with the explanation, maybe you could try the Open/Closed Principle next? Thanks.

  • @HeatElectro
    @HeatElectro 4 หลายเดือนก่อน

    Thank you so much for this content! I wonder how you would define the layout of the several components in the ProductPage? Inside the component or would you put it somewhere separately?

  • @Tesfamichael.G
    @Tesfamichael.G 5 หลายเดือนก่อน

    Excellent

  • @eshginfarzaliyev
    @eshginfarzaliyev 5 หลายเดือนก่อน

    Thanks, man

  • @emmanuelareiza9699
    @emmanuelareiza9699 18 วันที่ผ่านมา

    TY From Colombia

  • @st0maklija
    @st0maklija หลายเดือนก่อน

    00:04 The single responsibility principle emphasizes that a component should have one and only one reason to change.
    02:25 Single responsibility principle ensures code maintainability and bug identification
    04:30 ProductsPage component is violating the single responsibility principle
    06:40 Creating a custom hook for fetching products in React
    08:39 Implement single responsibility principle in React by delegating specific tasks to separate components.
    10:52 Delegate UI logic to separate components for reusability
    12:54 Implementing Single Responsibility Principle in React
    15:10 Separating responsibilities for components in React

  • @Gringo0517
    @Gringo0517 5 หลายเดือนก่อน +2

    Awesome and clear explanations! I was curious about exports. Here u are using default exports but I see a lot of codebases use named exports. When would u choose one over the other?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      They're both fine, I'm just used to default exports personally

    • @shakapaker
      @shakapaker 5 หลายเดือนก่อน

      ​@cosdensolutions In my experience named exports are easier to refactor cause the import name will change but with default, it can leave the old one which can be confusing and it will not even error

  • @stanislauyan3204
    @stanislauyan3204 5 หลายเดือนก่อน +2

    Thank you for this video. Your code is really great! It is really important to teach this idea! The value of it is huge and is really important to follow this design principle. However!
    You cannot apply SOLID to react directly. SOLID was made for OOP.
    You also violate this rule in your previous video if you use this principle as it was described in SOLID. Single responsibility principle is also not single feature principle. It says - you should have ONE REASON to change. It says nothing about “it does one thing”!!! This is important!
    I would suggest to never use S in connection to the SOLID in react.
    In is even more to U in CUPID principles!

  • @doniaelfouly4142
    @doniaelfouly4142 หลายเดือนก่อน

    Thanks

  • @bramreinold
    @bramreinold 4 หลายเดือนก่อน

    Hi, well explained mate! I'm wondering if you have also a more advanced example where you do CRUD (refetching data after creating a new item for example).

  • @yurikhunyk2877
    @yurikhunyk2877 5 หลายเดือนก่อน

    Greate video!
    Can you explain in the same way rest of SOLID princeples?)

  • @user-wy9rj6km6n
    @user-wy9rj6km6n 5 หลายเดือนก่อน

    Thank you for the video. Just a small question, what's the structure of unit tests for this example?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน

      depends on what you want to unit test, I usually wouldn't unit test any of these components. I would only unit test UI components and components that are designed to be re-used across many places. In that case I'd colocate the unit test file with the component and write all the tests there.
      I do most of my testing with e2e integration tests generally

  • @user-ku2sn1wz1c
    @user-ku2sn1wz1c 5 หลายเดือนก่อน

    I would also pass the loading, and error props inside of these components and would do the checking inside of them. But that is a matter of taste. Anyway, things shown in the video distinguish juniors from more experienced guys.

  • @anaspk6413
    @anaspk6413 5 หลายเดือนก่อน

    "Great content."

  • @uzairahmed2975
    @uzairahmed2975 4 หลายเดือนก่อน

    Well Explained this help me alot to become a good developer, I have a question the same principle should follow in nextjs?

  • @fatehfarooqui3587
    @fatehfarooqui3587 5 หลายเดือนก่อน +1

    Would it be better if we move the conditional logic for showing loading or error or products inside the extracted components?
    So the productspage will have no conditionals

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      Nope, it's the responsibility of the products page to decide it wants to show something on loading. The loading component only has the responsibility to show loading UI

  • @LilyDotan
    @LilyDotan 5 หลายเดือนก่อน

    What vscode extensions / configurations do you use to the have missing import indication in the code (red underline under what is missing) and when you click on it - it adds the import automatically? (As you do in minute 06:52 in the video)
    Thanks :)

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน

      Have a whole video on my vscode setup!

  • @ahmedfoda9823
    @ahmedfoda9823 5 หลายเดือนก่อน +1

    thanks for this great video, can you talk about how we can write tests and do automated testing for react code?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน

      I have a video on cypress! But will make more

    • @ahmedfoda9823
      @ahmedfoda9823 5 หลายเดือนก่อน

      thanks@@cosdensolutions

  • @fadfooood
    @fadfooood 4 หลายเดือนก่อน

    Is it possible that error state or loading state could render together? Sometimes I need to dig deeper in React Query to know when error is reset.

  • @bongbuincyril6150
    @bongbuincyril6150 4 หลายเดือนก่อน

    I love u bro

  • @marwajomaa7594
    @marwajomaa7594 2 หลายเดือนก่อน

    any recommendation for advanced react like books, online websits, etc

  • @andreaverrecchia3907
    @andreaverrecchia3907 5 หลายเดือนก่อน

    In case I need to implement the "enabled" prop for useQuery, how can I do that? Is it enough to pass the 'enabled' prop and simply include it in the useQuery?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      you don't need to even include it in the useQuery, just pass it

  • @user-en2lj9xb6u
    @user-en2lj9xb6u 4 หลายเดือนก่อน

    which extensions u use in vs code...

  • @abel090713
    @abel090713 4 หลายเดือนก่อน

    I feel like you shouldn't be moving things around based on the single responsibility principal, The code at 9:00 was probably the best version of this code. You can clearly tell the output of the UI based on state and you don't have to navigate to different components that only do one thing resulting in you trying to keep multiple pieces in your head, Things living in one place makes it easier to understand and debug (big components are not inherently bad). You should be moving things into their own components based on re-usability and functionality. You would want a loading and error component not because they should only have one responsibility but rather because you want to reuse them several times in your app. And you might want to move the product UI into it's own component if you needed some logic to run per component.

  • @balamanohar4946
    @balamanohar4946 5 หลายเดือนก่อน

    Is single responsibility principle and modularity both are same ?

  • @user-cm2nz9ik4v
    @user-cm2nz9ik4v 5 หลายเดือนก่อน

    Hello Cosden you are seriously a great mentor for me
    Hope that you remember me can you please suggest me how i can improve this type of code please let me know where i can share the file

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      post it on the Discord, you'll get answers!

    • @user-cm2nz9ik4v
      @user-cm2nz9ik4v 5 หลายเดือนก่อน

      I have shared the code please check thanks in advance.

  • @nanonkay5669
    @nanonkay5669 2 หลายเดือนก่อน

    This is good, but the single responsibility principle doesn't necessarily mean everything should do just one thing. It could be things that are closely related as well.

  • @MrJettann
    @MrJettann 5 หลายเดือนก่อน

    I should ask you, is it good to just check for products(array) in this way? Because empty array will also return true, I'm usually checks for !!pruducts?.length for that. Am I doing it wrong?)

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน

      yeah it's fine, if it's an empty array it will render the ProductList but no products will show. It depends on how you want to structure it

    • @MrJettann
      @MrJettann 5 หลายเดือนก่อน

      @@cosdensolutions yeah, that's true, but there will be empty div inside html, this is not good IMHO

  • @Amoz21
    @Amoz21 4 หลายเดือนก่อน

    Can you do video for all SOLID Principles applied to react application

  • @user-kl9hr5ev1n
    @user-kl9hr5ev1n 5 หลายเดือนก่อน

    👍

  • @raphael.portela
    @raphael.portela 5 หลายเดือนก่อน

    can you do a video on composition pattern with a more real world apporach instead of a simple component showing a message that is shown on the various videos about composition pattern?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน

      you mean component composition? i.e. Select, Select.Option, etc?

    • @raphael.portela
      @raphael.portela 5 หลายเดือนก่อน

      @@cosdensolutions yes!

  • @user-ll4qy6cg9i
    @user-ll4qy6cg9i 5 หลายเดือนก่อน

    Should we use isError or error in react query?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      both, depending on what you need

  • @tnnz9920
    @tnnz9920 2 หลายเดือนก่อน

    sir, could you put results instead of only code on videos? anyway I like ur videos

  • @jspesh
    @jspesh 4 หลายเดือนก่อน

    This is great but can you do it on a 'real' application? Bit more complex?

    • @cosdensolutions
      @cosdensolutions  4 หลายเดือนก่อน

      Yeah, building a whole project in my upcoming course where we do all of this globally and more design patterns

    • @jspesh
      @jspesh 4 หลายเดือนก่อน

      @@cosdensolutions Excellent. Thanks! I love your content, it's been really helpful

    • @jspesh
      @jspesh 4 หลายเดือนก่อน

      @@cosdensolutions Excellent. Thanks! I love your content, it's been really helpful

  • @2gbeh
    @2gbeh 5 หลายเดือนก่อน +1

    I prefer the product-list should just be part of the page component because the logic won't change or grow overtime. The entire logic is basically a loop and i feel that's too small to be extracted.

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน

      So all of my videos are kept super simple right? It will never be just that amount of code. In real projects it's often way more so this pattern applies. Sure if it's a personal small project, you can get away with putting everything in one main component, but I'm not teaching you to build simple projects

    • @ardianhotii
      @ardianhotii 5 หลายเดือนก่อน

      I mean you are kinda right but he's teaching how to write code in the best way possible for scaling and managing apps

  • @idiot3641
    @idiot3641 5 หลายเดือนก่อน

    Shouldn't we pass the error and loading state as a parameter to those components?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      For loading not really, for the error one, you could pass it the error so it displays it

    • @idiot3641
      @idiot3641 5 หลายเดือนก่อน

      @@cosdensolutions 👍

  • @rakulagn4598
    @rakulagn4598 5 หลายเดือนก่อน

    The Approach is Good Until If you need to Fetch The Product based on Pagination Data Definitely you must place your fetching logics inside the components that's the better way we can't pass the pagination values to hooks everytime right ?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +2

      I usually hold the fetching logic in the page component and the ProductList component can just take a callback whenever it reached the end of the list to fetch more products

  • @BSEFM-MUHMMADFARAZALI
    @BSEFM-MUHMMADFARAZALI หลายเดือนก่อน

    Great content, can you please share the source-code?

  • @mahendrasinhgohil44
    @mahendrasinhgohil44 3 หลายเดือนก่อน

    It’s make really hard to debug if nested component there without typescript 😅

    • @cosdensolutions
      @cosdensolutions  3 หลายเดือนก่อน

      everything is harder to debug without typescript 😁

  • @Simple_OG
    @Simple_OG 5 หลายเดือนก่อน

    Same for next js projects ?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน

      yeah, just no hooks or state in server components but same principles apply

    • @Simple_OG
      @Simple_OG 5 หลายเดือนก่อน

      @@cosdensolutions Thanks i made some changes in my project `import { Notes } from "@prisma/client";
      import SingleWobbleBadge from "@/components/Dashboard/Home/SingleWobbleBadge";
      import SingleWobbleDescription from "@/components/Dashboard/Home/SingleWobbleDescription";
      import SingleWobbleImage from "@/components/Dashboard/Home/SingleWobbleImage";
      import SingleWobbleTitle from "@/components/Dashboard/Home/SingleWobbleTitle";
      interface SingleWobbleProps {
      wobble: Notes;
      }
      export default function SingleWobble({ wobble }: SingleWobbleProps) {
      const { category, createdAt, description, imageUrl, title } = wobble;
      return (



      );
      }
      ` what do you think earlier i am rendering all in same component

  • @user-rt1kv6su5o
    @user-rt1kv6su5o 5 หลายเดือนก่อน

    I'm in my 20s learning to be a programmer/coding, is it too late or not? I'm doubtful about my current age of 🙂

  • @souviksarkar8691
    @souviksarkar8691 4 หลายเดือนก่อน

    make a video on zod.

  • @bl1tzQ
    @bl1tzQ 4 หลายเดือนก่อน

    So, do you mean that, if I have 100 pages, I should create 100 custom hooks just to fetch data from API? What about DRY?
    Why we can’t just create 1 universal hook and use it anywhere?

    • @cosdensolutions
      @cosdensolutions  4 หลายเดือนก่อน

      Well yeah, if you have pages, users, posts, comments, and 100 more entities you should make a hook for each. Although you won't in practice.
      If you have 100 user pages, one hook is what you need

    • @birapci
      @birapci 4 หลายเดือนก่อน

      You may have 100 pages but also your queries wont be much different. So you can implement an universal-like hook for 'Users' which requires the optional query params (like createdAt-updatedAt-roleId etc.). In every single page you can customise your query.

  • @mel_alejandrino
    @mel_alejandrino 5 หลายเดือนก่อน

    do you have typescript tutorial?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      will soon post a JSX to TSX video!

    • @mel_alejandrino
      @mel_alejandrino 5 หลายเดือนก่อน

      @@cosdensolutions thank you!

  • @partiid
    @partiid 5 หลายเดือนก่อน +1

    Very informative video indeed however i don't think this was some sophisticated example. Would highly appraciate some more complicated examples of solid. Anyway, thanks for posting!

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      I mean, this is for beginners mostly so I keep it simple, but for what it's worth, most of your components should look this simple even in a big app

  • @DazzyDude00
    @DazzyDude00 5 หลายเดือนก่อน

    You'd think experienced devs would use snippets. Not typing out: export default function... everytime 😂

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      Ok so I will comment on this. I have snippets, however I just made the change from arrow functions to declaring them the old school way and I didn't get to the snippets yet lol. But it is fixed in a couple of videos haha

  • @davidhusted817
    @davidhusted817 5 หลายเดือนก่อน

    Avoid impure functions as we can this is the SRP

  • @qureshiowais6951
    @qureshiowais6951 หลายเดือนก่อน

    instead of theory we need how we can do !!! it

  • @rimha6846
    @rimha6846 5 หลายเดือนก่อน

    The SRP does not mean doing one thing

    • @gerryramosftw
      @gerryramosftw 2 หลายเดือนก่อน

      what does single mean tho

  • @hesoncontroler
    @hesoncontroler 5 หลายเดือนก่อน

    I do most of what you're suggesting here. But, I would have suggested that unless your ui components need to be reused, it is actually easier to keep them in the safe file.
    If you're extracting UI components to separate files and they are not reused anywhere else. That's just silly. And actually harder to understand imo.

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      It's not silly. I'm teaching how to build complex apps, and in complex apps, you'll always re-use these components so defaulting to this pattern makes sense

  • @MathForAll81
    @MathForAll81 5 หลายเดือนก่อน

    Hi, we need a playlist for different design pattern implementations in react 🙏🏻

  • @anonymous_basics
    @anonymous_basics 5 หลายเดือนก่อน

    how i can test this components. and is it necessary to make tests for all the components ?

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน

      I honestly mostly only do e2e tests of the whole app, and not individual components

  • @anonymous_basics
    @anonymous_basics 5 หลายเดือนก่อน

    my team mates doesn't follow even half of this. It is so hard to go through the project. i wish they watch this video 😂

  • @nawazishali274
    @nawazishali274 5 หลายเดือนก่อน

    Can I connect with you on social media accounts to see timeline about your latest videos ,twitter ,insta or any other etc...

    • @cosdensolutions
      @cosdensolutions  5 หลายเดือนก่อน +1

      I'm not on twitter, but you can check me out here, on Instagram, or TikTok!

    • @nawazishali274
      @nawazishali274 5 หลายเดือนก่อน

      @@cosdensolutions Got it !