import React, { PropTypes } from 'react';
import history from './history';

export default function Link(props) {
    const { href } = props;
    return (<a
        href={href}
        onClick={event => {
            event.preventDefault();
            history.push(href);
        }}
    >
        {props.children}
    </a>);
}

Link.propTypes = {
    href: PropTypes.string.isRequired
};
