Skip to content

Changing ProfileView Class Component to Hook Component#5646

Closed
anirbanpaulcom wants to merge 7 commits intoRocketChat:developfrom
anirbanpaulcom:HookComponent
Closed

Changing ProfileView Class Component to Hook Component#5646
anirbanpaulcom wants to merge 7 commits intoRocketChat:developfrom
anirbanpaulcom:HookComponent

Conversation

@anirbanpaulcom
Copy link
Contributor

@anirbanpaulcom anirbanpaulcom commented Apr 8, 2024

Proposed changes

Changing ProfileView from a class component to a hook component for using react-hook-form .

Issue(s)

Solves This Issue : #5544

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

@anirbanpaulcom
Copy link
Contributor Author

@GleidsonDaniel , @diegolmello , Please take a look.

user.bio === bio &&
user.nickname === nickname &&
!newPassword &&
user.name === state.name &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if you personally changed it or used some tool to make this change, but just this block here "kills" the migration, using a simple state for this entire flow will make the performance of this screen much worse.
The correct option would be useReduce or a form lib.

Copy link
Contributor Author

@anirbanpaulcom anirbanpaulcom Jul 16, 2024

Choose a reason for hiding this comment

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

@GleidsonDaniel #5544 This PR will solve the problem. This PR is for integrating react-hook-form. Let me know if any other files, like RegisterView need to be changed from class to function components.

@anirbanpaulcom
Copy link
Contributor Author

Hey @diegolmello, #5544 this PR is for integrating react-hook-form Let me know if any other files, like RegisterView need to be changed from class to function components. Thank you.

@anirbanpaulcom
Copy link
Contributor Author

Hey @diegolmello, #5544 this PR is for integrating react-hook-form Let me know if any other files, like RegisterView need to be changed from class to function components. Thank you.

@anirbanpaulcom
Copy link
Contributor Author

Hey @diegolmello, #6166 and #5543 both can be solved by this, please take a look.

@diegolmello
Copy link
Member

Closing in favor of #6036
Thanks for your contribution! 🙏🏼

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.

3 participants