Hi Jakub,
thank you for your comment: I really appreciate it!
I'm not saying that the Atomic Design is the panacea to all evils (it has some limits of course). What I wrote is that it can help you to think in reusable components way.
Let's say we have a `SubscriptionButton`, which opens a newsletter
subscription modal - this is a lot of logic, so we'll put it to Organisms.
I think this approach is not correct: the SubscriptionButton shouldn't have any kind of logic, but it should have a trigger prop to be used for launching events (in your case opening a Modal).
The SubscriptionModal should be a different component and, using React, the best scenario could be something like:
<SubscriptionModal><!-- A subscription form--></SubscriptionModal>
I would put the logic part in the component which wrap both SubscriptionButton and SubscriptionModal.
I agree! I think that I didn't use a proper example for this 😄 I used Atomic Design in a project a few years ago and I forgot already about the specific cases where we struggled with using it.
I don't say it's a bad pattern, it just didn't work for me for some reason 😄
Oh, forgot to mention: your article is great!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Jakub,
thank you for your comment: I really appreciate it!
I'm not saying that the Atomic Design is the panacea to all evils (it has some limits of course). What I wrote is that it can help you to think in reusable components way.
I think this approach is not correct: the
SubscriptionButton
shouldn't have any kind of logic, but it should have atrigger
prop to be used for launching events (in your case opening a Modal).The
SubscriptionModal
should be a different component and, using React, the best scenario could be something like:I would put the logic part in the component which wrap both
SubscriptionButton
andSubscriptionModal
.What do you think? 🙂
I agree! I think that I didn't use a proper example for this 😄 I used Atomic Design in a project a few years ago and I forgot already about the specific cases where we struggled with using it.
I don't say it's a bad pattern, it just didn't work for me for some reason 😄
Oh, forgot to mention: your article is great!