DEV Community

Discussion on: ⚛️ Applying Strategy Pattern in React (Part 1)

Collapse
 
polaroidkidd profile image
Daniel Einars

Great read and can be used with hooks as well as opposed to having class components with extend the abstract call

Collapse
 
itswillt profile image
Will T. • Edited

Thanks for your feedback! Great to hear that it was a good read.

Actually, I'm not using a class component here. Also, this can be implemented using hooks, but the logic is quite pure and not coupled to React at all, so I don't want force the logic into a hook.

Collapse
 
verthon profile image
Krzysztof Sordyl

Moreover - the strategy pattern makes it really easy to test as unit test.