TypeError: Cannot read property 'getString' of undefined
See original GitHub issueGetting the error:
TypeError: Cannot read property 'getString' of undefined
This error is located at:
in OTPInputView (at OTPScreen.js:9)
As mentioned in the pinned issue, I installed @react-native-community/clipboard, still facing the same issue. I did yarn cache clean, deleted node_modules and yarn. lock and even then didn’t work.
My package.json:
"@react-native-community/clipboard": "^1.5.1",
"@twotalltotems/react-native-otp-input": "^1.3.11",
OTPSceen component:
import React from 'react';
import { View, Text, StyleSheet, SafeAreaView } from 'react-native';
import OTPInputView from '@twotalltotems/react-native-otp-input';
const OTPScreen = () => {
return(
<View style={styles.otpContainer}>
<Text>Inside OTP Screen</Text>
<OTPInputView
style={{width: '80%', height: 200}}
pinCount={4}
codeInputFieldStyle={styles.underlineStyleBase}
codeInputHighlightStyle={styles.underlineStyleHighLighted}
onCodeFilled = {(code => {
console.log(`Code is ${code}, you are good to go!`)
})}
/>
</View>
);
};
Could you please advise, what am I missing here?
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:12
Top Results From Across the Web
how can i fix this: Uncaught TypeError: Cannot read property ...
i am able to do so. But i keep on getting undefined value at my first index value in the iteration, tho the...
Read more >Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError: Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an undefined...
Read more >Uncaught TypeError: Cannot read property 'string' of undefined
Hi, We are using and loading react files for other part of the website. But we are not using react with flexmonster.
Read more >cannot read properties of null (reading 'trim') - You.com
that means, the variable vname is undefined . To prevent this error from occurring, you can use the ternary operator to set the...
Read more >Cannot read property 'toString' of Undefined in JavaScript
The "Cannot read property 'toString' of undefined" error occurs when the toString() method is called on an undefined value. To solve the error,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I faced this issue and solved it by using these versions
“@twotalltotems/react-native-otp-input”: “1.3.5”, “@react-native-community/clipboard”: “^1.5.1”,
facing same issue but not work with above solution