SHARE
TWEET

Untitled

a guest Jun 26th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Fragment } from 'react';
  2. import { Button } from '@material-ui/core';
  3.  
  4. const Page = props => {
  5.     const { history } = props;
  6.  
  7.     return (
  8.         <Fragment>
  9.             <Button
  10.                 variant="contained"
  11.                 color="primary"
  12.                 size="large"
  13.                 onClick={() => history.push('/some-route')}
  14.             >My Button</Button>
  15.         </Fragment>
  16.     );
  17. };
  18.  
  19. export default Page;
  20.      
  21. import React, { Fragment } from 'react';
  22. import { Button } from '@material-ui/core';
  23. import { Redirect } from 'react-router-dom';
  24.  
  25. const Page = props => {
  26.     const { history } = props;
  27.  
  28.     return (
  29.         <Fragment>
  30.             <Button
  31.                 variant="contained"
  32.                 color="primary"
  33.                 size="large"
  34.                 onClick={() => <Redirect to={'/some-route'} />}
  35.             >My Button</Button>
  36.         </Fragment>
  37.     );
  38. };
  39.  
  40. export default Page;
  41.      
  42. import React, { Fragment } from 'react';
  43. import { Link } from 'react-router-dom';
  44.  
  45. const Page = props => {
  46.     return (
  47.         <Fragment>
  48.             <Link
  49.                 class="MuiButtonBase-root-124 MuiButton-root-98 MuiButton-contained-109 MuiButton-containedPrimary-110 MuiButton-raised-112 MuiButton-raisedPrimary-113 MuiButton-sizeLarge-122"
  50.                 to="/some-route"
  51.             >My Button</Button>
  52.         </Link>
  53.     );
  54. };
  55.  
  56. export default Page;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top