Rocket.Chat.ReactNative icon indicating copy to clipboard operation
Rocket.Chat.ReactNative copied to clipboard

[FIX] Non primitive dependency on useSubscriptionRoles

Open reinaldonetof opened this issue 3 years ago • 0 comments

Proposed changes

We're using an array as a dependency inside useEffect, which is going to make the useEffect be recreated on every render. Instead of using the array, we change the subscriptions role type from array of strings, to string, and use it as a param to the array of dependencies.

Issue(s)

How to test or reproduce

Screenshots

Types of changes

  • [x] 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

  • [x] I have read the CONTRIBUTING doc
  • [x] I have signed the CLA
  • [x] 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

Jira: NATIVE-84

reinaldonetof avatar Oct 18 '22 18:10 reinaldonetof