From 9c8f2d7d31781f9936f3ef3ca5a24dbcfc9675b3 Mon Sep 17 00:00:00 2001 From: zyhou Date: Thu, 23 May 2019 22:44:50 +0200 Subject: [PATCH] Review isLoading --- examples/simple/src/comments/PostPreview.js | 1 + examples/simple/src/posts/PostCreate.js | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/simple/src/comments/PostPreview.js b/examples/simple/src/comments/PostPreview.js index f573f9794d9..2063f2a9a40 100644 --- a/examples/simple/src/comments/PostPreview.js +++ b/examples/simple/src/comments/PostPreview.js @@ -11,6 +11,7 @@ const PostPreview = props => { [props.resource, props.id], ); const version = useSelector(state => state.admin.ui.viewVersion); + const isLoading = useSelector(state => state.admin.loading > 0); return ( diff --git a/examples/simple/src/posts/PostCreate.js b/examples/simple/src/posts/PostCreate.js index f2cb6b4fa13..b0acfaebfb1 100644 --- a/examples/simple/src/posts/PostCreate.js +++ b/examples/simple/src/posts/PostCreate.js @@ -29,11 +29,10 @@ const SaveWithNoteButton = props => { const { basePath, handleSubmit, redirect } = props; const handleClick = useCallback( - () => { - return handleSubmit(values => { + () => + handleSubmit(values => { dispatch(saveWithNote(values, basePath, redirect)); - }); - }, + }), [basePath, redirect], );