How to use AWS Amplify in React Native with Typescript Project?

I'm trying to add Amplify Authentication in my react native project which uses typescript. There is a package given in amplify documentation 'aws-amplify-react-native' which is used as a middleware to authenticate our application. But this package is only supported in projects which are based on javascript. For Typescript it shows an error like

Could not find a declaration file for module 'aws-amplify-react-native'.
Try `npm install @types/aws-amplify-react-native` if it exists or add a new declaration (.d.ts) file containing `declare module 'aws-amplify-react-native';`

There is no package available like '@types/aws-amplify-react-native'

So anyone can help me out of this?


Unfortunately there are no defined types at the time of this answer. However, you can invoke @ts-ignore like so

// @ts-ignore
import Amplify, { Auth } from 'aws-amplify';
// @ts-ignore
import awsconfig from './aws-exports';
// @ts-ignore
import { withAuthenticator } from 'aws-amplify-react-native'

Amplify.configure(awsconfig);

There are no official TypeScript (TS) types available for aws-amplify-react-native at the moment. To suppress the TypeScript warning, you need to define your own TS declaration file (*.d.ts).

To get approximate typings, you can copy this file into your project. These are typings written by the GitHub user dantasfiles. Bear in mind that they are not exact and could be specified more precisely.