@kofile/react-child-window

0.3.0 • Public • Published

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

Package Sidebar

Install

npm i @kofile/react-child-window

Weekly Downloads

2

Version

0.3.0

License

MIT

Last publish

Collaborators

  • sergio.garcia
  • sergioatgovos
  • lilia.tirado
  • pantelissd
  • hd-kofile
  • oliverhoff
  • fernandofgovos
  • bwgovos
  • juandagovos
  • matt_huntsberry
  • afine_govos
  • bthomas_govos
  • chrisburch-govos
  • rarzate
  • narekdaghlaryan
  • daniltarasov
  • kofilesystems
  • neezer
  • scottkof
  • jbalfantz
  • ngraves
  • arturhovhannisyan1994volo
  • rachel-ftw
  • warrenyoungkofile