Open History to see the last commit
1import React from 'react'
2import { Typography } from '@material-ui/core'
3import { makeStyles } from '@material-ui/core/styles'
4import { Link } from '@material-ui/core'
5import { Link as RouterLink } from 'react-router-dom'
6β
7export default function Home() {
8 const classes = useStyles()
9β
10 return (
11 <div>
12 <Typography variant="h2">React Query Demo</Typography>
13 <Typography variant="subtitle1">Using the Rick And Morty API</Typography>
14 <Typography variant="subtitle2">
15 (Built by <a href="https://twitter.com/axelfuh">@axelfuh</a>)
16 </Typography>
17 <section className={classes.main}>
18 <Typography variant="h5">Why React Query?</Typography>
19 <Typography variant="body1">
20 In this demo you will be able to see how React Query is a significant
21 improvement over <strong>redux</strong>, <strong>mobx</strong>, and
22 any other general-purpose state container.
23 </Typography>
24 <Typography variant="body1">
25 No reducers, thunks, or sagas. No ES6 models to maintain in order to
26 tag them as observable.
27 </Typography>
28 <Typography variant="body1">
29 Simply associate a key with your fetch call and let{' '}
30 <strong>React Query</strong> handle the rest.
31 </Typography>
32 <Typography variant="h5">Ready to get started?</Typography>
33 <Typography variant="body1">
34 Check out the{' '}
35 <Link component={RouterLink} to="/episodes">
36 Episodes
37 </Link>{' '}
38 and{' '}
39 <Link component={RouterLink} to="/characters">
40 Characters
41 </Link>
42 !
43 </Typography>
44 </section>
45 </div>
46 )
47}
48β
49const useStyles = makeStyles(() => ({
50 main: {
51 margin: '44px 0',
52 '& p': {
53 margin: '12px 0 24px',
54 },
55 },
56}))