This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An individual movie | |
useQuery(['movies', 5], ...); | |
// A list of movies that are "released" | |
useQuery(['movies', { type: 'released' }], ...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// Disable in production | |
if (process.env.NODE_ENV !== 'production') { | |
var axe = require('react-axe'); | |
axe(React, ReactDOM, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// Disable in production | |
if (process.env.NODE_ENV !== 'production') { | |
var axe = require('react-axe'); | |
axe(React, ReactDOM, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import usePageTitle from 'hooks/usePageTitle'; | |
const ListPage = ({ items = [] }) => { | |
usePageTitle('List of items'); | |
return ( | |
<div className="list-component"> | |
<ListTitle title="List component" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const usePageTitle = title => { | |
useEffect(() => { | |
document.title = title; | |
}, [document]); | |
}; | |
export default usePageTitle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="list-component"> | |
<div class="list-title"> | |
<span>List component</span> | |
</div> | |
<div class="list-component-items"> | |
<span>List item 1</span> | |
<span>List item 2</span> | |
</div> | |
</div>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Fragment } from 'react'; | |
const ListItem = ({ item }) => ( | |
<Fragment> | |
<span>{item}</span> | |
</Fragment> | |
); | |
// Try to avoid index as key's |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="list-component"> | |
<div class="list-title"> | |
<span>List component</span> | |
</div> | |
<div class="list-component-items"> | |
<div> | |
<span>List item 1</span> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const ListItem = ({ item }) => ( | |
<div> | |
<span>{item}</span> | |
</div> | |
); | |
const List = ({ items = [] }) => ( | |
<div className="list-component"> |
NewerOlder