Skip to content

db-console: convert login components to functional components#164534

Draft
jasonlmfong wants to merge 1 commit intocockroachdb:masterfrom
jasonlmfong:jf/console-login-func-2
Draft

db-console: convert login components to functional components#164534
jasonlmfong wants to merge 1 commit intocockroachdb:masterfrom
jasonlmfong:jf/console-login-func-2

Conversation

@jasonlmfong
Copy link
Member

Convert the following class components to functional style:

  • PasswordLoginForm:
    1. class state → useState for username and password
    2. handleUpdate methods simplified to direct setter references
  • LoginPage:
    1. componentDidUpdate redirect → useEffect with loggedInUser dep
    2. renderError kept as inner function
  • RequireLogin:
    1. componentDidMount + componentDidUpdate → single useEffect
    2. connect + withRouter → useSelector + useHistory + useLocation

Epic: CRDB-58145
Release note: None

Convert the following class components to functional style:
- PasswordLoginForm:
    1. class state → useState for username and password
    2. handleUpdate methods simplified to direct setter references
- LoginPage:
    1. componentDidUpdate redirect → useEffect with loggedInUser dep
    2. renderError kept as inner function
- RequireLogin:
    1. componentDidMount + componentDidUpdate → single useEffect
    2. connect + withRouter → useSelector + useHistory + useLocation

Epic: CRDB-58145
Release note: None
@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 27, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants