A pretty loading spinner based on Google's colorful spinner animation.
npm install react-loading-animation
A simple loading component to show a colorful animated spinner.
``javascript`
const Loading = require('react-loading-animation');
You can either render the component directly (with no props) or render it as a parent
of other components and pass in isLoading as a prop:
`javascript`
const ListOfThings = ({ isFetching, things }) => {
if (isFetching && things.size() == 0) return
return (
...
);
}
or
`javascript``
const ListOfThings = ({ isFetching, things }) => {
return (
...
);
}
This component is based on the work at https://codepen.io/jczimm/pen/vEBpoL