Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert class components to functional components #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Jul 20, 2023

Description

This PR converts the class components in the codebase to functional components. This improves the codebase by using the latest React features and simplifying the component structure.

Changes Made

  • Converted the App and BuiltEmitter components in packages/react-scripts/fixtures/kitchensink/template/src/App.js into functional components.
  • Converted the StackTrace component in packages/react-error-overlay/src/containers/StackTrace.js into a functional component.

Checklist

  • All tests pass successfully.
  • The code follows the project's coding conventions.
  • The code is properly formatted and documented.
  • The changes have been tested locally.

Screenshots (if applicable)

N/A

Related Issues

Closes #6

Fixes #6.

To checkout this PR branch, run the following command in your terminal:

git checkout sweep/convert-class-to-functional

Copy link
Author

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! Good job on the refactoring work. However, there are a couple of changes needed:

In packages/react-error-overlay/src/containers/StackTrace.js:

  • The useEffect hook on lines 36-39 has a reference error. isInternalUrl is not defined in the scope of the hook. Please check this.

In packages/react-scripts/fixtures/kitchensink/template/src/App.js:

  • The setFeature method has been removed from the App class component but it might be used elsewhere in the code. Please ensure that this change does not break any other parts of the code.

Keep up the good work!

Copy link

@prechayimmee prechayimmee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Details

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.

sweep: Turn all class components into functional components
1 participant