Skip to content

Sweep: Normalize components declarations to export default named functions #1

@0xGeegZ

Description

@0xGeegZ

Description

We need to standardize the way we define React functional components in our codebase. Currently, we have a mix of two different patterns, and we want to stick to one for consistency.

⚠️ Warning ⚠️

  • Only update React functional components. Do not change class components or utility functions.
  • Only update the exported function of the component. Internal functions should remain unchanged.

Current Pattern

Files are currently using this pattern:

export default function ComponentName() {
  ...
}

Desired Pattern

We want all files to use this pattern:

const ComponentName = (props: any) => {
  ...
}
export default ComponentName;

Task

  • Find all instances of the old pattern in the codebase.
  • Update them to the new pattern.

Acceptance Criteria

  • All React functional components should be defined using the new pattern.
  • The application should build and run without errors after the changes.

Warning : Update ONLY code to follow this request, DO NOT update anything else and DO NOT add comments .

Checklist
  • components/magicui/tweet-card.tsx ✅ Commit 29e0820
• Replace the old pattern `export default function ComponentName()` with the new pattern `const ComponentName = (props: any) => {}` and add `export default ComponentName;` at the end of the component for `MyTweet`, `TweetCard`, and `ServerTweetCard`.
  • components/landing/examples/examples.tsx ❌ Failed
• This file does not seem to contain any React functional components based on the provided snippet. Therefore, no changes are required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions