Page MenuHomePhabricator

[web] Memoize `NotificationsOption` `onSelect` prop w/ `useCallback` hook
ClosedPublic

Authored by atul on May 15 2022, 7:44 AM.
Tags
None
Referenced Files
F3174823: D4042.diff
Thu, Nov 7, 6:18 PM
F3174380: D4042.id12757.diff
Thu, Nov 7, 4:25 PM
F3172103: D4042.id12756.diff
Thu, Nov 7, 2:23 PM
Unknown Object (File)
Thu, Oct 17, 7:34 PM
Unknown Object (File)
Thu, Oct 17, 7:34 PM
Unknown Object (File)
Thu, Oct 17, 7:34 PM
Unknown Object (File)
Thu, Oct 17, 7:34 PM
Unknown Object (File)
Thu, Oct 17, 7:34 PM

Details

Summary

The NotificationsOption onSelect callback prop was being defined inline instead of being memoized with React.useCallback. This diff just fixes that.

Test Plan

Clicked through the NotificationsModal and things worked as expected.

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul published this revision for review.May 15 2022, 7:46 AM
This revision is now accepted and ready to land.May 16 2022, 8:12 AM
This revision now requires review to proceed.May 16 2022, 8:39 AM
This revision is now accepted and ready to land.May 16 2022, 9:12 AM
web/modals/threads/notifications/notifications-modal.react.js
44–45 ↗(On Diff #12752)

This was prettier

Ran into strange prettier issue when landing this. Will update after investigating

This revision is now accepted and ready to land.May 16 2022, 10:10 AM

rebase after fixing prettier/eslint issue