diff --git a/app/javascript/gabsocial/features/compose/compose.js b/app/javascript/gabsocial/features/compose/compose.js index 7c1a8925..60dc9806 100644 --- a/app/javascript/gabsocial/features/compose/compose.js +++ b/app/javascript/gabsocial/features/compose/compose.js @@ -1,6 +1,21 @@ +import { clearCompose } from '../../actions/compose' import ComposeFormContainer from './containers/compose_form_container' -export default class Compose extends PureComponent { +const mapDispatchToProps = (dispatch) => ({ + onClearCompose:() => dispatch(clearCompose()) +}) + +export default +@connect(null, mapDispatchToProps) +class Compose extends PureComponent { + + static propTypes = { + onClearCompose: PropTypes.func.isRequired, + } + + componentWillUnmount() { + this.props.onClearCompose() + } render () { return (