question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'getString' of undefined

See original GitHub issue

Getting 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>
  );
};

image

Could you please advise, what am I missing here?

Thanks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12

github_iconTop GitHub Comments

13reactions
Omaksousacommented, Jun 13, 2021

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”,

2reactions
vdewanggacommented, Aug 5, 2021

facing same issue but not work with above solution

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found