hungdev / react-native-instagram-login

a react native instagram login component (support android & ios). Pull requests are welcome!
https://www.npmjs.com/package/react-native-instagram-login
184 stars 103 forks source link

Adding types #111

Open MrShtrahman opened 2 years ago

MrShtrahman commented 2 years ago

Hi, this project is pretty nice :)

I think that changing it to typescript and adding types would make this project even better

hungdev commented 2 years ago

I dont have much time to do it. Feel free to create a pull request. I really appreciate it.

UmidbekU commented 1 year ago

Hi everyone, add to declarations.d.ts

declare module 'react-native-instagram-login' {
  import * as React from 'react'

  interface InstagramLoginProps {
    ref: React.RefObject<any>
    appId: string
    appSecret: string
    redirectUrl: string
    scopes: string[]
    onLoginSuccess?: (data?: { access_token: string; user_id: number }) => void
    onLoginFailure?: (error: string) => void
    modalVisible?: boolean
    responseType?: string
    containerStyle?: object
    wrapperStyle?: object
    closeStyle?: object
  }

  export default class InstagramLogin extends React.Component<InstagramLoginProps> {}
}