refactor(templates): remove React.FC usage from CLI landing page components#281
Open
gonzoblasco wants to merge 1 commit into
Open
refactor(templates): remove React.FC usage from CLI landing page components#281gonzoblasco wants to merge 1 commit into
gonzoblasco wants to merge 1 commit into
Conversation
…ts (akd-io#277) Replace React.FC and FC type annotations with plain function components and inline prop types across all 9 landing page template components. Components updated: - Link, Paragraph, Container, InlineCode, Subtitle - TechnologyGrid, Section, TechnologyGridItem, headings (H1-H4)
|
@gonzoblasco is attempting to deploy a commit to the 9ty Team on Vercel. A member of the Team first needs to authorize it. |
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.
Remove
React.FCusage from CLI (#277)Closes #277
Summary
Removes
React.FCandFCtype annotations from all landing page template components in the CLI'sprod-assetsdirectory. The website was already done in #275; this completes the CLI side.Changes
Replaced
FC<Props>/React.FC<Props>with plain function components and inline prop types across 9 components:Link.tsx—React.FC<LinkProps>→ plain functionheadings.tsx—FC<ComponentProps<"h1-h4">>→ plain functions (H1, H2, H3, H4)Container.tsx—FC<ContainerProps>→ plain functionParagraph.tsx—FC<ComponentProps<"p">>→ plain functionInlineCode.tsx—FC<ComponentProps<"code">>→ plain functionSubtitle.tsx—FC<ComponentProps<"p">>→ plain functionSection.tsx—FC<ComponentProps<"section">>→ plain functionTechnologyGrid.tsx—FC<TechnologyGridProps>→ plain functionTechnologyGridItem.tsx—FC<TechnologyGridItemProps>→ plain functionWhy
React.FCis discouraged in modern React because it implicitly addschildrento props (even when not needed) and provides no benefit over plain function components with explicit prop types.Verification
pnpm run build— cleanpnpm run lint— no errorspnpm run unit— 9/9 tests passFCorReact.FCusage inprod-assets/