samedi 2 janvier 2021

How to pass prop which depends on another prop?

I have fullscreen: () => void prop which calls the fullscreen function. This function is not available in all browsers. What is the recommended way to convey this information to child?

  1. I can send another boolean prop
  2. I can pass NoOp and check for it in child
  3. ??? Anything else ???

The child will show/hide fullscreen UI element based on the value it gets

Aucun commentaire:

Enregistrer un commentaire