I'm using Material UI for a button and want to render a different functional component onClick of a button. I'm doing this all in a functional component as well. ( is the component I want to trigger)
const driveAction=props =>{
return <SharedDriveAction/>;
}
const Vehicle = ({vehicle}) => {
const classes = useStyles();
return (
<Button
onClick= {() => { driveAction }}
size="small"
color="secondary"
className={classes.button}
>
Drive
</Button>
);
}
export default Vehicle;