Commit 5c39d0f
committed
ZulipStatusBar: Fix types in
Some changes I was experimenting with somehow inspired Flow
to start pointing out things like
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/common/ZulipStatusBar.js:71:20
Property backgroundColor is missing in props [1].
src/common/ZulipStatusBar.js
68│ export default connect((state, props) => ({
69│ safeAreaInsets: getSession(state).safeAreaInsets,
70│ theme: getSettings(state).theme,
71│ backgroundColor: props.backgroundColor || getTitleBackgroundColor(props.narrow)(state),
72│ orientation: getSession(state).orientation,
73│ }))(ZulipStatusBar);
74│
src/chat/ChatScreen.js
[1] 36│ <ZulipStatusBar narrow={narrow} />
Where indeed, that code uses `props.backgroundColor` in a way that
looks like it assumes such a prop is present. It doesn't really, but
that's hard to tell without more context.
Make the logic more explicit, which fixed those errors. As a bonus,
the two remaining "ST is not a React component" errors go away too!connect call.1 parent 2410627 commit 5c39d0f
File tree
3 files changed
+12
-9
lines changed- src
- common
- main
3 files changed
+12
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
0 commit comments