davidtheclark / react-aria-modal

A fully accessible React modal built according WAI-ARIA Authoring Practices
http://davidtheclark.github.io/react-aria-modal/demo/
MIT License
1.04k stars 96 forks source link

Clarifying behavior wrt children when modal is not mounted #64

Closed oyeanuj closed 6 years ago

oyeanuj commented 6 years ago

Hi @davidtheclark,

I noticed that when children are passed to the <AriaModal /> component, they are being accessed/rendered even when the mounted is false. I was a little surprised by that, and was wondering if that is by design.

If yes,

  1. Do you think we should mention it in the docs in the mounted section so that folks are aware?
  2. Thoughts on a render prop pattern where the AriaModal component can take a function as a child and let it know if it is mounted or not?

Thanks!

davidtheclark commented 6 years ago

:wave: @oyeanuj.

I noticed that when children are passed to the component, they are being accessed/rendered even when the mounted is false.

Demo four shows usage of the mounted property working as expected: the modal is not rendered when mounted={false}. So I either don't understand your question or you might have a bug in your implementation?

davidtheclark commented 6 years ago

Closing as stale.