import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; export default class Spoilers extends React.PureComponent { static propTypes = { spoilerText: PropTypes.string, children: PropTypes.node, }; state = { hidden: true, } handleSpoilerClick = () => { this.setState({ hidden: !this.state.hidden }); } render () { const { spoilerText, children } = this.props; const { hidden } = this.state; const toggleText = hidden ? : ; return ([

{spoilerText} {' '}

,
{children}
]); } }