Пікірлер
@tohirul
@tohirul 25 күн бұрын
why did you stop making videos?
@bhakti214
@bhakti214 27 күн бұрын
what in the world, it is like a magic to me, gonna deep dive to get a better understanding so I hope i can implement it in my use case. thanks A LOT man!
@imornar
@imornar 2 ай бұрын
Imagine having this dude with his keyboard in your office
@patrickudekwe
@patrickudekwe 2 ай бұрын
Is this for only software developers?
@PhilipIsaacs
@PhilipIsaacs 2 ай бұрын
Excellent Tutorial.
@Lemmy4555
@Lemmy4555 3 ай бұрын
This is a good pattern to use, especially for low level components. prefer slots over props to keep the code of the component easy. Another suggestion i would give is to make the components do as little as possible, whatever you are not sure is not going to be reused most of the times should stay in the parent, i think a common mistake is to pass the options props to a Select component, but the options may be in many format, value-label, value-label-andLotOfOtherStuff, maybe you don't even need the label because you are showing a bunch of icons, also the options may come from an API or may be filterable, and the filtering logic may vary, etc. So just move the handling of the options and the selection of the value in the parent and it will simplify the code of the Select greatly, while the code in the parent would be easy to understand because it will be very specific for that Select.
@K.Huynh.
@K.Huynh. 4 ай бұрын
thank you for sharing!
@user-gm3lg8gp3m
@user-gm3lg8gp3m 4 ай бұрын
Great tip!
@shane3744
@shane3744 4 ай бұрын
This was very helpful and informative! I have a couple of questions if you have time to answer: 1. Why does <ProductCard> use slot props as opposed to only "children" like the compound components? 2. Are there concerns about bundle size when using compound components since you're always importing all of them?
@krishna9438
@krishna9438 2 ай бұрын
old comment but I'm guessing slots restricts the order of components or DOM structure (ie image on top, info in the middle, cta button on the bottom) based on ProductCard's implementation while children have more wiggle room
@henriquematias1986
@henriquematias1986 4 ай бұрын
This is the way to go, sadly jr developers still have issues understanding how context work. We will get there tough ( :
@einfacherkerl3279
@einfacherkerl3279 4 ай бұрын
first time someone wrote react code using a typewriter!
@rea_kr
@rea_kr 4 ай бұрын
I would like to follow over your video from the initial code. I'd like to follow along while watching the video, starting from the initial code. Could you possibly provide the initial code too?
@utkarshsinghchouhan8819
@utkarshsinghchouhan8819 5 ай бұрын
Man I was Just Thinking about the Same Problem for Scalable Components" and The KZbin Recommended it to me. I am Happy now😊😊
@angstrom1058
@angstrom1058 5 ай бұрын
Great video, Vincas. Thank you.
@XDBjoernXD
@XDBjoernXD 5 ай бұрын
wow, I learned a lot
@miettoisdev
@miettoisdev 6 ай бұрын
you're still using props, those should be children components
@toonmystoryanimated.6766
@toonmystoryanimated.6766 6 ай бұрын
No link
@streetjnoun
@streetjnoun 7 ай бұрын
I wish I saw your video earlier. I just had a live coding interview and had no idea about this principle...
@frank13621
@frank13621 8 ай бұрын
Clicking through these posts and half no longer exist and many are just send resume to an email with hardly any description or salary. Are you getting replies applying on this?
@justAbeautifulSoul409
@justAbeautifulSoul409 8 ай бұрын
for independent calls allsetteled is better than all
@Gangbuster74
@Gangbuster74 8 ай бұрын
but wont it affect performance when we map 10 to 100 cards, creating so many context in the back?
@malkythealky
@malkythealky 9 ай бұрын
Very clear explanation, thank you
@isaacjon
@isaacjon 9 ай бұрын
thanks i love it
@isaacjon
@isaacjon 9 ай бұрын
nice 🔥
@darksider6113
@darksider6113 9 ай бұрын
The idea is great but in nextjs 14 you can only use this component in the client side not on server side. Can anyone explain why?
@LocdNCoded
@LocdNCoded 9 ай бұрын
Concurrently not parallel 😅
@ducky.coding
@ducky.coding 10 ай бұрын
Let's see if I understood correctly the right use cases of this: I should/could use this whenever I have a component that needs some more details, but those details alone wouldn't be something that I could reuse elsewhere Seems like this, am I right? :)
@lucascampos4237
@lucascampos4237 10 ай бұрын
This video has insane value. I'm working on my own web app, and this concept, when well applied and in the right situation, is a game-changer. The code without it, turns out to be simply a mess, but when applied properly, it provides the exact modularity needed. Awesome!
@luv.matters
@luv.matters 11 ай бұрын
Everyone on KZbin uses Typescript, but companies haven't converted yet 🤷🏼‍♀
@vincaslt
@vincaslt 11 ай бұрын
Just remove types and you have JS in that case. You may be the first one to introduce TS in your company, I did that in 3 of the companies I worked at.
@luv.matters
@luv.matters 11 ай бұрын
Maybe startups, but not main tech companies! Merry Christmas :)@@vincaslt
@danielson9490
@danielson9490 11 ай бұрын
Considering info & action prop as childrens would make this more clean and easy to understand
@ScottUmble
@ScottUmble 11 ай бұрын
This is great, never thought of doing it this way.
@djoscarmix
@djoscarmix 11 ай бұрын
I found this really intesting approach, but the disadvantage i see now its that all components become Client Components, instead server components and you can not fetch data directly in the component in the server side
@djoscarmix
@djoscarmix 11 ай бұрын
btw if component is not too complex you can pass the data by props not using the context, keeping the server component
@anusharajendra389
@anusharajendra389 Жыл бұрын
Where is the link
@valenciawalker6498
@valenciawalker6498 Жыл бұрын
Thank you
@popuguytheparrot_
@popuguytheparrot_ Жыл бұрын
KZbin bloggers grows to read documentation
@psyferinc.3573
@psyferinc.3573 Жыл бұрын
love this video. i learnt soemthing new and had to come back to it just to see what i missed.
@somebody-17546
@somebody-17546 Жыл бұрын
Wow. Very helpful.
@amaury_permer
@amaury_permer Жыл бұрын
I feel like we're getting back to writing plain Html 😅
@CarlosRodriguez-pn7fe
@CarlosRodriguez-pn7fe Жыл бұрын
That's an amazing explanation for me, thanks a lot!.
@PaulSebastianM
@PaulSebastianM Жыл бұрын
HOCs delegate rendering to other components while only composing them. They are not a solution to boolean flags. There is too much going on in this video and the premise is lost. Much of the boolean-ness can be more simply taken care of with optional props. Ie, no price, don't display the price. You don't necessarily need to pass a full DTO to a component. A component's interface should not leak implementation details.
@PaulSebastianM
@PaulSebastianM Жыл бұрын
Your to this looks awfully lot like having manually written the JSX to look like you want minus the ordering of the "slots". So, I'm not sure I see an improvement...
@miggu
@miggu Жыл бұрын
Thank you for the video. You can achieve namespacing by perhaps importing everything on a separate file as non default exports if the issue at hand is too many lines of imports. I will personally always favour <ProductImage/> to <Product.Image/> as on the latter you're creating a data dependency where the first one you can easily erase Product and <Product.image/> will still exist. You could then import everything in one line.
@qaz1617
@qaz1617 Жыл бұрын
Amazing, thanks
@JohnBuildWebsites
@JohnBuildWebsites Жыл бұрын
Great video. Not 100% sold on it all being a best practice, but really useful for everyone to understand how it works
@JlNGLEZ
@JlNGLEZ Жыл бұрын
I myself, prefer to develop components so they're easier to use consumer side, I feel like providing variations of a component as a prop is much easier, pass through an Id for the product, and have all logic relating to fetching and deciding layout to the component, learning curve for other developers is much nicer, and you're using the same composition in every place, it makes it much harder to fix bugs or make changes, where if it's inside the component, maintenance is much easier, you end up having to create wrapper components too many times with composition too so that things are reusable
@DanielSimaodaSilva
@DanielSimaodaSilva Жыл бұрын
Great video, but for me it's missing how to do unit test with those components
@HelenaDuGraus
@HelenaDuGraus Жыл бұрын
What intrigues me is that he imports several components that are used inside ProductCard outside of ProductCard and that logically speaking seems very wrong. It looks pretty nice on the innermost components, but look at the size of its imports list on the outermost layer. I think it's cleaner to have 6 components with 20 lines than 5 components with 5 lines and one with more than 100.
@Irakli008
@Irakli008 Жыл бұрын
10 seconds in and I’d already subscribed! Really liked this tutorial, looking forward to your future content. KZbin needs a lot more React design pattern videos like this.
@detaaditya6237
@detaaditya6237 Жыл бұрын
It depends. If a function need the value from the previous function, then it's not a mistake
@RSo-fc3qf
@RSo-fc3qf Жыл бұрын
Hello bhaiya private company me job kaise paye please bataiyega bhaiya