Page MenuHomePhabricator

[web] add style prop to icon component
ClosedPublic

Authored by benschac on Mar 4 2022, 11:30 AM.
Tags
None
Referenced Files
F3300189: D3346.diff
Sun, Nov 17, 6:36 PM
Unknown Object (File)
Fri, Nov 15, 8:59 AM
Unknown Object (File)
Fri, Nov 15, 8:59 AM
Unknown Object (File)
Fri, Nov 15, 8:59 AM
Unknown Object (File)
Sun, Nov 10, 7:32 AM
Unknown Object (File)
Sat, Nov 2, 8:20 AM
Unknown Object (File)
Sat, Nov 2, 8:20 AM
Unknown Object (File)
Sat, Nov 2, 8:20 AM

Details

Summary

we need a style prop to override inline styles the component gives us as defaults. This is a part of the API, I just never added it to the prop types initially.

style prop in icomoon component: https://github.com/aykutkardas/react-icomoon/blob/master/src/index.tsx#L71

Test Plan

We shouldn't have any type errors using the style prop, and the styles in the style prop should work as expected.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks right to me... adding @ashoat as blocking reviewer since flow/I don't have much experience with the $Shape utility

This revision is now accepted and ready to land.Mar 4 2022, 12:38 PM
This revision now requires review to proceed.Mar 6 2022, 8:48 AM

This is a cool find – I've never actually encountered CSSStyleDeclaration before.

It took me some time to figure out if $Shape is necessary here. I saw CSSStyleDeclaration show up in the Flow lib, but I couldn't find any usage of $Shape<CSSStyleDeclaration>. I played around with it myself to confirm that $Shape was necessary, but for next time this is the kind of case where the diff author has the opportunity to save both reviewers a lot of time if you preemptively explain things that might be confusing.

This revision is now accepted and ready to land.Mar 7 2022, 10:26 PM