Importing always returns undefined
See original GitHub issueHey there!
Firstly, thank you for creating and actively maintaining this package. I am very excited to use it!
Unfortunately, I am getting undefined whenever I try to import from react-native-bluetooth-classic
.
Code ran
import RNBluetoothClassic, {
BTEvents,
BTCharsets,
} from 'react-native-bluetooth-classic';
const MyComponent = () => {
console.log(RNBluetoothClassic.isEnabled());
return (
<View />
);
};
Result
Unhandled JS Exception: TypeError: Cannot read property 'isEnabled' of undefined
Note that
- Importing the file directly from
node_modules
also yields the same error - Directly
console.log
ging RNBluetoothClassic, BTEvents, and BTCharsets all yieldundefined
- Manually linking with Cocoapods yields the same error
Versions
Platform: iOS
React native: 0.61.5
I also used yarn add
instead of npm install
, not sure if it makes a difference, but I can’t use npm install
for other reasons.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
React Redux this.props always return undefined
I'm now at React and I'm doing some apps to study, learn more about. Aand right now I'm trying to add the logged...
Read more >Imports/requires return undefined #11562 - babel/babel - GitHub
I found out that happens when there is a _interopRequireDefault with a file inside the project which defers the resolving of modules or...
Read more >Function returning 'undefined' - The freeCodeCamp Forum
My issue is when I import and use the function within a react function component the function suddenly only returns 'undefined'.
Read more >Imported es6 module is undefined during Debug (During Test ...
Undefined variables while debugging must be caused by wrong/missing name mappings in sourcemaps: if the variable is renamed while transpiling/ ...
Read more >All imported functions are undefined - Get Help - Vue Forum
All imported functions are undefined ... It always behaves the same way tho: ... console.log(get) // logs that it is a function
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 FreeTop 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
Top GitHub Comments
It’s not in the readme, but it’s literally the second thing on the document page
https://www.kenjdavidson.com/react-native-bluetooth-classic/ios/#mfi-protocols
Oh, I see, you meant the second part
I’ll add that now.
thank for your asking, for who want to know what things we have to add: