React-modal: Confusing props? Should we rethink them?

Created on 17 Dec 2016  路  4Comments  路  Source: reactjs/react-modal

Perhaps we should consider standardizing on a set of "lifecycle" callbacks. We have some of these such as onAfterOpen and onRequestClose.

I'm thinking we should deprecate/remove them in favor of a standardized set such as:

  • onBeforeOpen
  • onAfterOpen
  • onReady
  • onBeforeClose
  • onAfterClose
discussion

Most helpful comment

That's really great. Also, I guess we can drop before and after from the names.

  • onOpen
  • onOpened
  • onReady
  • onClose
  • onClosed

All 4 comments

That's really great. Also, I guess we can drop before and after from the names.

  • onOpen
  • onOpened
  • onReady
  • onClose
  • onClosed

Looking at this again, I think I want to keep the Before and After just to make it very clear when these things will be fired. I figure it'll be less typo prone and more understood in the long run.

Are these still being worked on? I need to way to hook into the onBeforeOpen lifecycle.

@mdodge-ecgrow +1
I'm in the same position. I need to differentiate if the Modal has been opened by using the keyboard or the mouse in order to add an outline to the modal or not.

But my helper-class will be removed by the time it's onAfterOpen's turn.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jrock17 picture jrock17  路  4Comments

petertdinh picture petertdinh  路  4Comments

bjbrewster picture bjbrewster  路  4Comments

emwee picture emwee  路  4Comments

istok20 picture istok20  路  3Comments