WikiEduDashboard icon indicating copy to clipboard operation
WikiEduDashboard copied to clipboard

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

Open Yash121l opened this issue 1 year ago • 1 comments

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.

Yash121l avatar Jun 16 '24 16:06 Yash121l

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.

ragesoss avatar Jun 17 '24 19:06 ragesoss