react-actionsheet

1.2.0 • Public • Published

react-actionsheet

Installation

npm i react-actionsheet --save

Demo

example gif

class App extends Component {
 
  state = {
    show: false
  }
 
  onClick = () => {
    const { show } = this.state
    this.setState({show: !show})
  }
 
  onRequestClose = () => {
    this.onClick()
  }
 
  render() {
    const { show } = this.state
 
    const tip = show ? '隐藏' : '显示'
    const menus = [{content: '点我'}, {content: '不要点我'}]
 
    return (
      <div>
        <button onClick={this.onClick}>{tip}</button>
 
        <Actionsheet show={show} menus={menus} onRequestClose={this.onRequestClose} />
      </div>
    )
  }
}

Versions

Current Tags

Version History

Package Sidebar

Install

npm i react-actionsheet

Weekly Downloads

267

Version

1.2.0

License

ISC

Unpacked Size

369 kB

Total Files

16

Last publish

Collaborators

  • newraina