doc: fix example in readme
This commit is contained in:
parent
4d44818baf
commit
d2c99a578b
2 changed files with 2 additions and 9 deletions
|
@ -36,14 +36,7 @@ const MoviesEndpoint: Endpoint = {
|
|||
type MoviesResponse = Movie[];
|
||||
|
||||
function App() {
|
||||
const [movies, { data, loading }] = useRequest<MoviesResponse>(MoviesEndpoint);
|
||||
|
||||
React.useEffect(
|
||||
() => {
|
||||
movies();
|
||||
},
|
||||
[movies]
|
||||
);
|
||||
const { data, loading } = useRequest<MoviesResponse>(MoviesEndpoint);
|
||||
|
||||
return !data ? (
|
||||
<div>{ loading ? 'Loading...' : 'Something went wrong' }</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "react-rest-request",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"description": "Minimalistic REST API client for React inspired by Apollo",
|
||||
"readme": "README.md",
|
||||
"main": "./target/index.js",
|
||||
|
|
Reference in a new issue