issue: ENG-8914
Refactoring from class to function
Details
Details
- Reviewers
tomek will - Commits
- rCOMMb0ad2ef37bb1: [native] Move onTipContainerLayout
Tested by creating a nux tooltip and displaying it - still works
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
native/tooltip/nux-tips-overlay.react.js | ||
---|---|---|
300 ↗ | (On Diff #43115) | It's a bit hacky to use a useMemo for this. I think the usual "best practice" is that an instance variable from a class component becomes a useRef in a function component. This is functionally the same in our configuration of React, but it might become more important in "concurrent mode", if we ever enable that (might be related to React Native "new architecture") |
native/tooltip/nux-tips-overlay.react.js | ||
---|---|---|
300 ↗ | (On Diff #43115) | Another reason for using ref here is that we usually assume that values returned by memos are immutable. The value that we have here can mutate without its reference being changed, which is confusing. |
319 ↗ | (On Diff #43115) | We should make the dependencies more specific. |