issue: ENG-8618
To be able to get coordinest of buttons, we need to let them render first. Then, they will register their coordinates in this context. A handler component will select those coordinates, and navigate to screens passing the coordinates in params
Details
- Reviewers
tomek will - Commits
- rCOMM4277c95e4350: [native] Add nux context
Tested with following diffs. Testeds that after a button registares their coordinates the handler effect is fired and nux tip appears on the screen, rendering the button in the cprrect place
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/components/nux-tips-context.react.js | ||
---|---|---|
12–21 | What's the purpose of it? If we want to have one type with optional and one with mandatory fields, we can create a type with app the fields required and use https://flow.org/en/docs/types/utilities/#toc-partial for optional. | |
21 | This gets deprecated in flow 0.211 but we're not there yet. An alternative https://flow.org/en/docs/types/mapped-types/ is supported from 0.210. | |
38–54 | It seems like the intention here was to avoid a render after calling registerTipButton - which is good. But there's a small issue with the memo - it is fragile because we're mutating its content, which breaks intuitions about how memos work. Instead, we should use a ref to store the tipsProps. | |
58–61 | This is hacky. Can we store an empty object in tipsProps initially, and then fill it when calling registerTipButton? Here we would need to check the presence of keys from tip values. |
Address review. RequiredTipProps were dropped altogether after applying other review suggestions