timomeh / react-native-material-bottom-navigation

💅🔧👌 a beautiful, customizable and easy-to-use material design bottom navigation for react-native
MIT License
711 stars 127 forks source link

Fix Typescript UMD global error #125

Closed trevor-atlas closed 5 years ago

trevor-atlas commented 5 years ago

When trying to use this package with newer versions of typescript an error is generated (see below) This PR adds the missing import which resolves the problem!

node_modules/react-native-material-bottom-navigation/index.d.ts:58:49 - error TS2686: 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.

58   export default class BottomNavigation extends React.Component<
                                                   ~~~~~

node_modules/react-native-material-bottom-navigation/index.d.ts:61:32 - error TS2686: 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.

61   export class IconTab extends React.Component<IconTabProps> {}
                                  ~~~~~

node_modules/react-native-material-bottom-navigation/index.d.ts:62:32 - error TS2686: 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.

62   export class FullTab extends React.Component<FullTabProps> {}
                                  ~~~~~

node_modules/react-native-material-bottom-navigation/index.d.ts:63:36 - error TS2686: 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.

63   export class ShiftingTab extends React.Component<FullTabProps> {}
                                      ~~~~~

node_modules/react-native-material-bottom-navigation/index.d.ts:64:30 - error TS2686: 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.

64   export class Badge extends React.Component<BadgeProps> {}
trevor-atlas commented 5 years ago

I'd like to point out that the tests actually pass and the failure is due to the CI:

Test Suites: 10 passed, 10 total
Tests:       59 passed, 59 total
Snapshots:   0 total
Time:        10.602s
Ran all test suites.
Error: you must supply a CC_TEST_REPORTER_ID ENV variable or pass it via the -r flag
Usage:
  cc-test-reporter after-build [flags]
timomeh commented 5 years ago

Thank you! CI reports an error, but the tests are still green, it's just the codeclimate-connection. I'll fix it.

timomeh commented 5 years ago

Ah, I found it: CircleCI doesn't apply secret env vars in PR builds.

I fixed the circleci config. Could you please rebase/merge the current master into your branch? I'd like to see if that solves the failing build.

timomeh commented 5 years ago

Published in v1.0.4 🚀

Thank you for your contribution!