The new Flow was printing this error:
Error ------------------------------------------------------------------------------------------ themes/colors.js:304:10 Cannot return StyleSheet.create(...) because an index signature declaring the expected key / value type is read-only in Styles [1] but writable in object type [2]. [incompatible-variance] [2] 285| ): StyleSheetOf<IS> { [1] 286| const result: Styles = {}; : 301| } 302| result[key] = filledInStyle; 303| } 304| return StyleSheet.create(result); 305| } 306| 307| function styleSelector<IS: Styles>(
Styles actually isn't read-only, but React Native's type for StyleSheet.create limits its type param to be read-only.
I fixed it by making our StyleSheetOf type read-only. However, that exposed more errors where we use typeof unboundStyles, so I had to add $ReadOnlys to all of those.
Depends on D10024
wondering, shouldn't we also add action.type === fullStateSyncActionType?