react-modal icon indicating copy to clipboard operation
react-modal copied to clipboard

Confusing props? Should we rethink them?

Open claydiffrient opened this issue 8 years ago • 4 comments

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

claydiffrient avatar Dec 17 '16 16:12 claydiffrient

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

  • onOpen
  • onOpened
  • onReady
  • onClose
  • onClosed

diasbruno avatar Dec 17 '16 19:12 diasbruno

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.

claydiffrient avatar Mar 11 '17 03:03 claydiffrient

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

mdodge-ecgrow avatar Apr 21 '20 18:04 mdodge-ecgrow

@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.

LorenzKahl avatar May 12 '20 10:05 LorenzKahl