jeudi 12 mars 2020

Why are the props onClose and onOpen marked as required in the SwipeableDrawer in Material-UI?

What I understand about the need of properties like onOpen and onClose is that they try to implement the Observer pattern.

So, why should a client of the SwipeableDrawer that doesn't want to observe those events provide values for those properties? In my case, for example, since I do not want to be an observer, I had to provide empty arrow functions as values.

What is the rationale for this? What am I missing?

Aucun commentaire:

Enregistrer un commentaire