refactor: convert class components to function components#60
Merged
mjdavidson merged 1 commit intomasterfrom May 7, 2026
Merged
refactor: convert class components to function components#60mjdavidson merged 1 commit intomasterfrom
mjdavidson merged 1 commit intomasterfrom
Conversation
Replaces all 8 React.Component class definitions with function
components. Trivial since none used lifecycle methods, refs, or
setState callbacks.
- components/Alert.tsx, LoginWithEmail.tsx, LoginWithSSO.tsx
- pages/app/index.tsx (no state)
- pages/index.tsx (no state — split renderHero/Sections/Cta/Footer
into top-level helper consts since they share no scope)
- pages/app/{login,settings,sso}.tsx (state: success + message,
replaced with two useState hooks each)
Side wins:
- Drops every `override` modifier (no more class methods).
- Drops most `import React from 'react'`s.
- All exported functions are now `this`-free; oxlint
no-this-in-exported-function would flag any future regression.
Verified: typecheck (strict), lint (0 warnings), format, build
all pass.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All 8
React.Componentclasses → function components. None used lifecycle methods, refs, or setState callbacks, so the conversion is mechanical:class extends React.Component { override render() { return X } }to() => Xpages/app/{login,settings,sso}.tsx): replace constructor-set{ success, message }with twouseStatehooks eachpages/index.tsx'srenderHero/Sections/Cta/Footermethods become top-level helper consts (they share no scope with the page)Side wins: drops every
overridemodifier, drops mostimport React from 'react's, all exports are nowthis-free.