0.3.0 • Published 8 years ago

@kofile/react-child-window v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

React Child Window

Build Status Coverage Status

Ma Child

Usage

import { ChildWindow } from '@kofile/react-child-window'

const App = () => (
  <div>
    <Content>
    <ChildWindow
      onLoad={(childComp, childWindow) => { /* ... */ }}
      onUnload={(childComp, childWindow) => { /* ... */ }}
      options={[
        'url',
        'title',
        ...attributes
      ]}
      mountId='childCSSID'
      open={true}
      setRef={el => { /* ... */ }}
    >
      <User name='default' age='props' />
    </ChildWindow>
  </div>
)

Props

  • onLoad:

    • Function
    • (childComp, childWindow) => void
    • What to do when the child window loads
    • Similar to onComponentDidMount
  • onUnload:

    • Function
    • (childComp, childWindow) => void
    • What to do right before the child window unmounts/closes
    • Similar to componentWillUnmount
  • options:

    • Array<String>
    • [url, title, 'toolbar=false', 'menu=false']
    • url and title are normal strings with the rest of the array are window features
  • mountId:

    • String
    • 'mount'
    • The #id of the element to treat as the domEl inside of ReactDOM.render(ReactEl, domEl)
  • open:

    • Boolean
    • false
    • If this child window is open or not
0.3.0

8 years ago

0.1.0

8 years ago

0.0.0

8 years ago