Open anthonytietjen opened 5 years ago
import React, { useEffect } from 'react'; import iTunes from 'react-native-itunes'
const App: () => React$Node = () => { useEffect(() => { iTunes.getTracks().then((tracks) => { console.log(tracks); }) }, [])
return (<></>) }
export default App;
5. react-native run-ios --simulator="iPhone 11" 6. Turn on the debugger 7. You'll see this error:
Running application GetAllTracks ({ initialProps = { }; rootTag = 21; }) setUpDeveloperTools.js:73 Running "GetAllTracks" with {"rootTag":21,"initialProps":{}} setUpDeveloperTools.js:73 Possible Unhandled Promise Rejection (id: 0): TypeError: Cannot read property 'getTracks' of undefined TypeError: Cannot read property 'getTracks' of undefined
@anthonytietjen I had the same problem and just submitted a pull request to fix it: https://github.com/kadiks/react-native-itunes/pull/26
const App: () => React$Node = () => { useEffect(() => { iTunes.getTracks().then((tracks) => { console.log(tracks); }) }, [])
return (<></>) }
export default App;
Running application GetAllTracks ({ initialProps = { }; rootTag = 21; }) setUpDeveloperTools.js:73 Running "GetAllTracks" with {"rootTag":21,"initialProps":{}} setUpDeveloperTools.js:73 Possible Unhandled Promise Rejection (id: 0): TypeError: Cannot read property 'getTracks' of undefined TypeError: Cannot read property 'getTracks' of undefined