In one of the exercises with a button, opening an alert and at the same time make the latter dismissible, the dismiss-functionality is passed along as a parameter.
I understand the concept, but won’t it make more sense to keep the dismiss-function inside the alert-component, assuming that all this behavior is common on all alerts, so that App.tsx shows the alert, while Alert.tsx removes itself?
As I see it; if we have multiple components that share the same, dynamic alert-functionality, it could potentially cause a lot of extra code and errors.
Any thoughts on this?