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

Refactor: Migrated timeline.jsx from Class Based Components to Functional Components. #5835

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Yash121l
Copy link

What this PR does

This pull request refactors the Timeline component from a class-based component to a functional component using React hooks. The key issues it addresses are:

  1. Modernizing the Code: Updates the component to use modern React practices, improving readability and maintainability.
  2. Performance Improvement: Implements useCallback with throttling for the scroll event handler to enhance performance.
  3. State Management: Simplifies state management by using useState.

These changes result in cleaner, more efficient, and easier-to-maintain code, while aligning with current React standards.

Open questions and concerns

This is my first time contributing to the Wiki Education Foundation. Refactoring has improved my understanding of code organization. If you find any errors or poor coding practices, please let me know and provide feedback.

…update imports and props, and simplify code structure."
@ragesoss
Copy link
Member

This is too complex of a file for me to feel comfortable with directly converting it to a functional component, and probably also larger than what you should attempt for a first PR. For this file in particular, I think we need to do some refactoring first to extract small components.

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