Page MenuHomePhabricator

[native] Move methods from Tooltip to functional compononent
ClosedPublic

Authored by angelika on Wed, Dec 11, 7:54 AM.
Tags
None
Referenced Files
F3509992: D14111.id46507.diff
Sat, Dec 21, 10:06 AM
F3509313: D14111.id46408.diff
Sat, Dec 21, 3:22 AM
F3508435: D14111.id46329.diff
Fri, Dec 20, 10:05 PM
Unknown Object (File)
Fri, Dec 20, 12:57 PM
Unknown Object (File)
Fri, Dec 20, 11:48 AM
Unknown Object (File)
Thu, Dec 19, 10:06 PM
Unknown Object (File)
Thu, Dec 19, 4:18 PM
Unknown Object (File)
Thu, Dec 19, 12:55 PM
Subscribers
None

Details

Summary

Move getTooltipItem, onPressMore, renderMoreIcon and onTooltipContainerLayout to the functional compoent as a part of Tooltip migration to functional component.

Depends on D14110

Test Plan

Open up some tooltips and verify they're looking correctly.
Open text message tooltip and press More, verify it works.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

angelika held this revision as a draft.
angelika edited the test plan for this revision. (Show Details)
ashoat added inline comments.
native/tooltip/tooltip.react.js
562–566 ↗(On Diff #46329)

We don't need to convert this into a callback... and in this case, I don't think we need a React.useMemo either. Arguably we can just pass in tooltipItem={boundTooltipItem}

573–578 ↗(On Diff #46329)

Can be a memo

This revision is now accepted and ready to land.Wed, Dec 11, 5:55 PM
angelika edited the test plan for this revision. (Show Details)

Rebase and address feedback

angelika added inline comments.
native/tooltip/tooltip.react.js
573–578 ↗(On Diff #46329)

I can't put renderMoreIcon in a memo, because BaseTooltipItem expects a callback, not a component

native/tooltip/tooltip.react.js
573–578 ↗(On Diff #46329)

Why can't you change BaseTooltipItem to take a React.Node though?

native/tooltip/tooltip.react.js
573–578 ↗(On Diff #46329)

I didn't realize it's a whole different file... sorry about this, please ignore my feedback here :)