Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Cannot read property 'getTracks' of undefined #25

@anthonytietjen

Description

@anthonytietjen
  1. react-native init ListAllTracks
  2. cd ListAllTracks
  3. npm install react-native-itunes --save
  4. Add the NSAppleMusicUsageDescription to info.plist
  5. Replace app.js with this:
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;
  1. react-native run-ios --simulator="iPhone 11"
  2. Turn on the debugger
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions