microsoft / TypeScript-React-Native-Starter

A starter template for TypeScript and React Native with a detailed README describing how to use the two together.
MIT License
1.91k stars 211 forks source link

no code hint to use StyleSheet.create #25

Open Joey-Huang opened 6 years ago

Joey-Huang commented 6 years ago

There is no code hint to use this method(use webstrom ide)

const styles = StyleSheet.create({ root: { alignItems: "center", alignSelf: "center" } });

hope when write 'a', a code prompt appears. [alignSelf....all start with 'a' ]

truongngoctuan commented 5 years ago

maybe you can try to do something similar to this

interface Style {
  main: ViewStyle;
  closeButton: ViewStyle;
  closeText: TextStyle;
}

const styles = StyleSheet.create<Style>({
  main: {
    flex: 1,
    ...,
  },
  closeButton: {
    textAlign: 'center',
    zIndex: 3,
    ...,
  },
  closeText: {
    fontSize: 48,
    ...,
  },
});