Flow: object literals not compatible with interface with indexable property

Created on 2 Sep 2016  路  2Comments  路  Source: facebook/flow

https://gist.github.com/aaronjensen/44251ed19c4b6635975925f3c7ca0463

const styles = StyleSheet.create({
  label: {
    marginRight: '1rem',
  },
})
flow-typed/unofficial/aphrodite.js:1435
1435:     create<T: StyleDeclaration>(styles: T): T;
                    ^^^^^^^^^^^^^^^^ Library type error:
1435:     create<T: StyleDeclaration>(styles: T): T;
                    ^^^^^^^^^^^^^^^^ property `$value` of StyleDeclaration. Indexable signature not found in
 25: const styles = StyleSheet.create({
                                      ^ object literal. See: client/app/components/forms/TextInput.js:25


Changing the StyleDeclaration interface to object works.

interfaces object model bug

All 2 comments

Same here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

funtaps picture funtaps  路  3Comments

jamiebuilds picture jamiebuilds  路  3Comments

cubika picture cubika  路  3Comments

mmollaverdi picture mmollaverdi  路  3Comments

john-gold picture john-gold  路  3Comments