Skip to content

Missing defintion of selectCurrentUsername #4724

@mattbal

Description

@mattbal

What docs page needs to be fixed?

https://redux.js.org/tutorials/essentials/part-4-using-data#adding-the-login-page

What is the problem?

The documentation is missing a code block showing the selector selectCurrentUsername being defined. Right now, if you read through the section Adding the Login Page, the code block for App.tsx imports selectCurrentUsername from './features/auth/authSlice'. But if you look at the most recent code block defining authSlice, there is no definition for that selector included.

What should be changed to fix the problem?

There's two options:

  1. Create a new code block beneath the App.tsx code block, showing selectCurrentUsername being defined:
// features/auth/authSlice.ts
export const selectCurrentUsername = (state: RootState) => state.auth.username

Or,

  1. Update the original authSlice codeblock to include this:
// features/auth/authSlice.ts
export const selectCurrentUsername = (state: RootState) => state.auth.username

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions