I am trying to make a project that can give me the IMEI number of my Mobile, using this package https://github.com/SimenCodes/react-native-imei, the problem is in my code there is a statement as, const IMEI = require('react-native-imei'); here in my code it is showing kind of three dots below 'r' of 'react-native-imei' on hovering over it, it says "could not find the declaration file for module ('react-native-imei')" although I have installed and linked then package in my project so what could be the reason? below is my code:
import React from 'react'
import { StyleSheet,TouchableOpacity ,Text,View} from 'react-native'
export default class Demo extends React.Component {
constructor () {
super()
this.state = {
deviceIMEI: '',
}
}
getIMEI = () => {
const IMEI = require('react-native-imei')
this.setState({
deviceIMEI: IMEI.getImei(),
})
}
render () {
return (
<View style={styles.container}>
<Text>{this.state.deviceIMEI}</Text>
<TouchableOpacity onPress={this.getIMEI}>
<Text>Get Current Device IMEI</Text>
</TouchableOpacity>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'flex-start',
},
})