Page MenuHomePhabricator

[web] [refactor] destructure props in message preview component
ClosedPublic

Authored by benschac on Mar 23 2022, 12:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 4:16 AM
Unknown Object (File)
Tue, Dec 17, 4:16 AM
Unknown Object (File)
Mon, Dec 16, 5:17 PM
Unknown Object (File)
Nov 8 2024, 8:09 PM
Unknown Object (File)
Nov 2 2024, 8:04 AM
Unknown Object (File)
Oct 7 2024, 4:46 AM
Unknown Object (File)
Oct 7 2024, 4:46 AM
Unknown Object (File)
Oct 7 2024, 4:46 AM

Details

Summary

no functionality changes. Just keeping the component consistent with the rest of the codebase and destructuring props.

Test Plan

message preview component still works like it did before changes.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek added inline comments.
web/chat/message-preview.react.js
24–25 ↗(On Diff #10627)

If we're always destructuring in the first statement, we can as well destructure as a function argument. What do you think about taking this approach in the future?

36 ↗(On Diff #10627)

messageInfoProps doesn't sound like a useful name... maybe originalMessageInfo?

This revision is now accepted and ready to land.Mar 25 2022, 3:36 AM
web/chat/message-preview.react.js
24–25 ↗(On Diff #10627)

We've stuck with the current pattern pretty consistently in the codebase. I'm for sticking with the current convention. IMO i like it more.

If we as a team want to change it lets agree and then codemod it everywhere: https://github.com/facebookarchive/codemod. Or whatever has replaced codemod.