react-child-window

0.0.2 • Public • Published

react-child-window

Sweet child o' miiiiiine

Build Status

Usage

import ChildWindow from 'react-child-window';

class App extends Component {
  state = {
    opened: false,
  }

  toggleChild = () => this.setState(({ opened }) => ({ opened: !opened }))

  render() {
    return (
      <div>
        <button onClick={this.toggleChild}>
          Open Child Window
        </button>
        <ChildWindow open={this.state.opened}>
          <h2>I will be rendered in the child window!</h2>
          <User name="Tim" profile={ { these: 'will be merged with ChildWindow props' }}/>
        </ChildWindow>
      </div>
    )
  }
}

export default App;

Dependents (0)

Package Sidebar

Install

npm i react-child-window

Weekly Downloads

194

Version

0.0.2

License

MIT

Last publish

Collaborators

  • beardedtim