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

perf: Avoid re-renders due to PropsContext #154

Merged
merged 4 commits into from
Mar 7, 2020
Merged

Conversation

tassoevan
Copy link
Collaborator

Each Box consumes and provides an new plain object value from PropsContext, that causes pointless re-renderings. Using a single empty object to represent no additional props and component memoization might fix that.

@tassoevan tassoevan added the ➕ Enhancement New feature or request label Mar 4, 2020
@tassoevan tassoevan requested a review from ggazzo March 4, 2020 03:24
@tassoevan
Copy link
Collaborator Author

@gabriellsh Could you please test it working on Rocket.Chat? Comparing the latest version against this branch via React DevTools profilling would be enough.

@gabriellsh
Copy link
Member

@gabriellsh Could you please test it working on Rocket.Chat? Comparing the latest version against this branch via React DevTools profilling would be enough.

tested, looks way better, thanks!

@tassoevan tassoevan marked this pull request as ready for review March 4, 2020 20:16
@tassoevan tassoevan merged commit da88341 into develop Mar 7, 2020
@tassoevan tassoevan deleted the perf/use-props branch March 7, 2020 14:45
gabriellsh added a commit that referenced this pull request Mar 11, 2020
…into feat/buttons

* 'develop' of github.com:RocketChat/Rocket.Chat.Fuselage: (26 commits)
  v0.4.0
  feat!: CSS-in-JS for modifiers of Box (#164)
  perf: Avoid re-renders due to PropsContext (#154)
  feat: useMutableCallback (#156)
  chore: Add bug report template (#158)
  feat: Added callback prop for scroll position (#155)
  fix: Display name and prop types of Throbber component (#148)
  fix: Changed accordion item title proptype (#151)
  v0.3.0
  fix: actionId on action hooks (#149)
  v0.2.0 (#150)
  chore: Tabs Layout (#125)
  feat: Loading Component (#147)
  v0.2.0
  v0.2.0-alpha.30
  fix: Safari not triggering buttons anchors (#146)
  v0.2.0-alpha.29
  bump version (#145)
  v0.2.0-alpha.28
  fix: placeholder transition (#144)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
➕ Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants