Skip to content
Permalink
5e979ec20c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
12 lines (10 sloc) 340 Bytes
/**
* Wrap an image tag as a React component to allow router linking.
*/
import React from 'react';
import { useHistory } from 'react-router-dom';
const NavImage = (props) => {
const history = useHistory();
return <img alt={props.alt} src={props.src} onClick={() => history.push(props.to)} />;
}
export default NavImage;