marcio / react-skylight

A react component for modals and dialogs
http://marcio.github.io/react-skylight/
MIT License
571 stars 97 forks source link

How can I use an IIFE to open a modal when the user first opens the web page ? #54

Closed aziz-boudi4 closed 7 years ago

aziz-boudi4 commented 7 years ago

I have a modal page popping up when the user clicks a button :

    `render() {
      return (
         <div>
             <section>
                 <button onClick={() => this.refs.simpleDialog.show()}>Open Modal</button>
             </section>
             <SkyLight hideOnOverlayClicked ref="simpleDialog" title="Test Modal">
                 Text that appears inside the modal page
                <Button onClick={() => this.refs.simpleDialog.hide()} >Got It</Button>
             </SkyLight>
        </div>
    )} `