Sha256: febf1ef0a1a351b7c29225512ce4efe3245ffeb9c61920ed67b9744eb684c412
Contents?: true
Size: 955 Bytes
Versions: 9
Compression:
Stored size: 955 Bytes
Contents
// @flow import React from "react" import { Toggle } from "../../" class Example extends React.Component { state = { toggle1: false, toggle2: true, } handleChange = event => { this.setState({ [event.target.name]: event.target.checked }) } render() { return ( <> <Toggle checked={this.state.toggle1} name="toggle1" onChange={this.handleChange} onCheck={event => console.log(`${event.target.name} checked!`)} onUncheck={event => console.log(`${event.target.name} unchecked!`)} /> <br /> <Toggle checked={this.state.toggle2} name="toggle2" onChange={this.handleChange} onCheck={event => console.log(`${event.target.name} checked!`)} onUncheck={event => console.log(`${event.target.name} unchecked!`)} /> </> ) } } export default Example
Version data entries
9 entries across 9 versions & 1 rubygems