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(props) {
8 const classes = useStyles()
9β
10 return (
11 <div>
12 <Typography variant="h2">React Query Demo</Typography>
13 <Typography variant="subtitle1">Using the Star Wars API</Typography>
14 <Typography variant="subtitle2">
15 (Built by <a href="https://twitter.com/Brent_m_Clark">@Brent_m_Clark</a>
16 )
17 </Typography>
18 <section className={classes.main}>
19 <Typography variant="h5">Why React Query?</Typography>
20 <Typography variant="body1">
21 In this demo you will be able to see how React Query is a significant
22 improvement over <strong>redux</strong>, <strong>mobx</strong>, and
23 any other general-purpose state container.
24 </Typography>
25 <Typography variant="body1">
26 No reducers, thunks, or sagas. No ES6 models to maintain in order to
27 tag them as observable.
28 </Typography>
29 <Typography variant="body1">
30 Simply associate a key with your fetch call and let{' '}
31 <strong>React Query</strong> handle the rest.
32 </Typography>
33 <Typography variant="h5">Ready to get started?</Typography>
34 <Typography variant="body1">
35 Check out the{' '}
36 <Link component={RouterLink} to="/films">
37 Films
38 </Link>{' '}
39 and{' '}
40 <Link component={RouterLink} to="/characters">
41 Characters
42 </Link>
43 !
44 </Typography>
45 </section>
46 </div>
47 )
48}
49β
50const useStyles = makeStyles((theme) => ({
51 main: {
52 margin: '44px 0',
53 '& p': {
54 margin: '12px 0 24px',
55 },
56 },
57}))