import React from 'react'; import {Collapse} from '../../src'; import text from './text.json'; const getText = num => text.slice(0, num).map(p =>

{p}

); export class Hooks extends React.PureComponent { constructor(props) { super(props); this.state = { isOpened: false, isResting: false, paragraphs: 0 }; } render() { const { isResting, isOpened, paragraphs, params } = this.state; return (
Resting: {' '} {isResting ? 'true' : 'false'} onRest/onWork arguments: {' '} {params}
this.setState({isResting: false, params: JSON.stringify(p)})} onRest={p => this.setState({isResting: true, params: JSON.stringify(p)})}>
{paragraphs ? getText(paragraphs) :

No text

}
); } }