Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jlaumelb
Contributor
Contributor

React Mashup - getAppList()

Hi All,

I am starting to play around with React to create a Qlik Sense mashup and am encountering issues when trying to retrieve an app listing on the Qlik Sense Server.   Below is the following code where I encounter an error in the second .then with an error of Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'then').

The first console.log(app) appears to be working in the console and I have attached a screenshot for reference.  

Any help would be much appreciated!

 

const app = qApp(testConfig, qlikTicket);
//console.log(app);

app.then(app => {
console.log(app);
app.getAppList().then(data=> {
setTest(data);
})
})

  

jlaumelb_0-1636696290908.png

 

1 Reply
Aiham_Azmeh
Employee
Employee

Hi @jlaumelb ,

 

Our client APIs, are sometimes inconsistent the `getAppList` method has a callback method, see example here

You should probably do instead:

const app = qApp(testConfig, qlikTicket);
//console.log(app);

app.then(app => {
  console.log(app);
  app.getAppList(data=> {
    setTest(data);
  })
})


I hope this helps,