/** * @flow * @file Back Button component * @author Box */ import * as React from 'react'; import classNames from 'classnames'; import { FormattedMessage } from 'react-intl'; import { Route, type Location } from 'react-router-dom'; import IconNavigateLeft from '../../../icons/general/IconNavigateLeft'; import messages from '../messages'; import PlainButton from '../../../components/plain-button'; import './BackButton.scss'; type Props = { className?: string, to?: Location, }; const BackButton = ({ className, to, ...rest }: Props) => ( {({ history }) => ( (to ? history.push(to) : history.goBack())} type="button" {...rest} > )} ); export default BackButton;