Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix Snackbar static constants type for typescript (#609)
### Motivation Below `Snackbar` usage has error. <img width="332" alt="2018-10-18 20 18 21" src="https://user-images.githubusercontent.com/434227/47150896-19790100-d313-11e8-8794-256703ab654b.png"> And error message: ``` path/to/my/component.tsx:131:17 - error TS2322: Type 'string' is not assignable to type 'number | undefined'. 131 duration={Snackbar.DURATION_SHORT} ~~~~~~~~ node_modules/react-native-paper/typings/components/Snackbar.d.ts:10:3 10 duration?: number; ~~~~~~~~ The expected type comes from property 'duration' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Snackbar> & Readonly<{ children?: ReactNode; }> & Readonly<SnackbarProps>' ``` Because `duration` was defined as a `string` in the type definition file. I fixed it. ### Test plan Typecheck for below jsx. ```jsx <Snackbar visible={true} duration={Snackbar.DURATION_SHORT}> Foo </Snackbar> ```
- Loading branch information