From 80723f510daa6ba4a272c2b1b86ea0da5598641e Mon Sep 17 00:00:00 2001 From: Kitravee Siwatkittisuk <50334192+kitravee@users.noreply.github.com> Date: Sun, 11 Oct 2020 01:45:59 +0700 Subject: [PATCH] Update use-reducer-example.component.jsx It should be currentUser --- .../use-reducer-example.component.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/use-reducer-example/use-reducer-example.component.jsx b/src/components/use-reducer-example/use-reducer-example.component.jsx index a2fd20a..9749dc3 100644 --- a/src/components/use-reducer-example/use-reducer-example.component.jsx +++ b/src/components/use-reducer-example/use-reducer-example.component.jsx @@ -36,7 +36,7 @@ const setSearchQuery = queryString => ({ const UseReducerExample = () => { const [state, dispatch] = useReducer(reducer, INITIAL_STATE); - const { user, searchQuery } = state; + const { currentUser, searchQuery } = state; useEffect(() => { const fetchFunc = async () => { @@ -57,11 +57,11 @@ const UseReducerExample = () => { value={searchQuery} onChange={event => dispatch(setSearchQuery(event.target.value))} /> - {user ? ( + {currentUser ? (
-

{user.name}

-

{user.username}

-

{user.email}

+

{currentUser.name}

+

{currentUser.username}

+

{currentUser.email}

) : (

No user found