This is why you should learn the Factory Pattern for React

  Рет қаралды 5,770

Lucas Barake

Lucas Barake

Күн бұрын

Пікірлер: 19
@sebastianmihaiprisacariu8975
@sebastianmihaiprisacariu8975 7 ай бұрын
Great video. I have used factory patterns in react, but never thought of using it in forms. Great idea!
@g-ytub
@g-ytub 11 ай бұрын
Excellent, thank you for very practical example. Please do continue with other design patters as well.
@lucas-barake
@lucas-barake 11 ай бұрын
More to come!
@pushkarkumar5578
@pushkarkumar5578 11 ай бұрын
though it is too advanced for me but learnt new thing thankyou.
@regilearn2138
@regilearn2138 11 ай бұрын
Please teach other patterns also related with React and example using real world, please use react for this
@yiannis_p
@yiannis_p 11 ай бұрын
Thank you so much for this! Any chance we could get a link to the repo??
@lucas-barake
@lucas-barake 11 ай бұрын
Added to the description!
@yiannis_p
@yiannis_p 11 ай бұрын
@@lucas-barake starred and followed!
@sebastianmihaiprisacariu8975
@sebastianmihaiprisacariu8975 6 ай бұрын
@@lucas-barake the repo does not include the factory-form.tsx file tho... :)
@anton9410
@anton9410 11 ай бұрын
this is pretty cool!
@sirtobey1337
@sirtobey1337 11 ай бұрын
If you have tons of forms, this abstraction can be a valid option. But please don‘t build these kinds of abstractions before you actually run into such issues. Projects with 10 static forms using such abstractions are usually so much harder to maintain than just typing out these 10 forms manually…
@lucas-barake
@lucas-barake 11 ай бұрын
I agree, it should never be the default approach. It depends entirely on the project requirements. If you have a dynamic form where the structure or fields can change based on user input or other conditions, using the factory pattern would be the wise choice. Or if you have hundreds of forms that are consistent. It's good to know these patterns so you know what to do when the time comes.
@dealloc
@dealloc 11 ай бұрын
And chances are that you have multiple forms that are structured the same way also makes this kind of abstraction obsolete and makes changes that much harder when requirements/design change that may be at odds with the abstraction. So either you then end up with a leaky abstraction or end up splitting it out anyway. You're far better off by using composition. With compound components you let the consumer of the API decide where things go from a UI perspective, each component can have a minimal API surface, and you can provide sane defaults for accessibility/validation using context.
@neotom8653
@neotom8653 11 ай бұрын
@@lucas-barakehey what theme do you use ? I really like it
@lucas-barake
@lucas-barake 11 ай бұрын
@@neotom8653It's Dim Night.
@SachinYadav-eh7vg
@SachinYadav-eh7vg 11 ай бұрын
Please make the form clone.
@ajayprakash1167
@ajayprakash1167 11 ай бұрын
Teach all the design pattern that are real projecr example and low level and high level design
@Jhean_Perdido
@Jhean_Perdido 11 ай бұрын
@Jhean_Perdido
@Jhean_Perdido 11 ай бұрын
Finally Fix Your Issues With JS/React Memory Management 😤
20:13
Jack Herrington
Рет қаралды 90 М.
Better Way of Sorting in TypeScript: Order
14:33
Lucas Barake
Рет қаралды 1,2 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
This is the Only Right Way to Write React clean-code - SOLID
18:23
8 Design Patterns | Prime Reacts
22:10
ThePrimeTime
Рет қаралды 451 М.
Goodbye, useEffect - David Khourshid
29:59
BeJS
Рет қаралды 505 М.
Refactoring a React component - Design Patterns
15:19
Cosden Solutions
Рет қаралды 101 М.
Un-Suck Your React Components - Composable & Compound Components
15:47
Паттерн Factory Method, Фабричный метод, С#, Unity
12:10
The Absolute Best Intro to Monads For Software Engineers
15:12
Studying With Alex
Рет қаралды 678 М.
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 38 М.
My Favorite Way to Fetch Data in React
16:28
Josh tried coding
Рет қаралды 72 М.