From 905f76f7bfa1436443d3ab94c4336219d37707c4 Mon Sep 17 00:00:00 2001 From: "Carr.z.w" Date: Tue, 21 Sep 2021 17:17:33 +0800 Subject: [PATCH] Document correction - update ReactRouter3.md 1. Correct the code logic in the example of `userIsNotAuthenticated`. 2. Align minor inconsistencies in code examples. --- docs/Getting-Started/ReactRouter3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Getting-Started/ReactRouter3.md b/docs/Getting-Started/ReactRouter3.md index a0ea9cc..1f21e3d 100644 --- a/docs/Getting-Started/ReactRouter3.md +++ b/docs/Getting-Started/ReactRouter3.md @@ -60,7 +60,7 @@ const userIsNotAuthenticated = connectedRouterRedirect({ // This prevents us from adding the query parameter when we send the user away from the login page allowRedirectBack: false, // Determine if the user is authenticated or not - authenticatedSelector: state => state.user.data !== null, + authenticatedSelector: state => state.user === null, // A nice display name for this check wrapperDisplayName: 'UserIsNotAuthenticated' }) @@ -86,7 +86,7 @@ When `authenticatingSelector` returns true, no redirection will be performed and ```js const userIsAuthenticated = connectedRouterRedirect({ redirectPath: '/login', - authenticatedSelector: state => state.user.data. !== null, + authenticatedSelector: state => state.user !== null, wrapperDisplayName: 'UserIsAuthenticated' // Returns true if the user auth state is loading authenticatingSelector: state => state.user.isLoading,