cloudflare / react-modal2

:thought_balloon: Simple modal component for React.
BSD 3-Clause "New" or "Revised" License
279 stars 16 forks source link

Modal in File #9

Closed kennetpostigo closed 8 years ago

kennetpostigo commented 8 years ago

Hello,

I'm wondering if I have to declare a modal component every time I use this like you did in the redux example? or do I just import react-modal2 like so

import Modal from 'react-modal2'

and declare a

<Modal> ... <Modal>
jamiebuilds commented 8 years ago

From the README:

Now this might seem like a lot to do every time you want to render a modal, but this is by design. You are meant to wrap ReactModal2 with your own component that you use everywhere. Your component can add it's own DOM, styles, animations, and behavior

So create your own modal component that you can easily import. Here is the reference example: https://github.com/cloudflare/cf-component-modal

kennetpostigo commented 8 years ago

@thejameskyle Thank you, Also one more little question. Does it work with functional components from v.0.14?

jamiebuilds commented 8 years ago

There's no reason it wouldn't