doc: fix example in readme

This commit is contained in:
Dmitriy Pleshevskiy 2020-11-06 01:14:56 +03:00
parent 4d44818baf
commit d2c99a578b
2 changed files with 2 additions and 9 deletions

View file

@ -36,14 +36,7 @@ const MoviesEndpoint: Endpoint = {
type MoviesResponse = Movie[]; type MoviesResponse = Movie[];
function App() { function App() {
const [movies, { data, loading }] = useRequest<MoviesResponse>(MoviesEndpoint); const { data, loading } = useRequest<MoviesResponse>(MoviesEndpoint);
React.useEffect(
() => {
movies();
},
[movies]
);
return !data ? ( return !data ? (
<div>{ loading ? 'Loading...' : 'Something went wrong' }</div> <div>{ loading ? 'Loading...' : 'Something went wrong' }</div>

View file

@ -1,6 +1,6 @@
{ {
"name": "react-rest-request", "name": "react-rest-request",
"version": "0.3.0", "version": "0.3.1",
"description": "Minimalistic REST API client for React inspired by Apollo", "description": "Minimalistic REST API client for React inspired by Apollo",
"readme": "README.md", "readme": "README.md",
"main": "./target/index.js", "main": "./target/index.js",