如何使Material UIreactButton
组件充当react-router-dom 中的Link
组件而不会失去其原始样式?就像点击改变路线一样。
import Button from '@material-ui/core/Button';
<Button variant="contained" color="primary">
About Page
</Button>
像这样,但保持原来的Button
风格:
import Button from '@material-ui/core/Button';
import { Link } from 'react-router-dom';
<Button variant="contained" color="primary">
<Link to="/about">
About Page
</Link>
</Button>