This is regarding custom apps. Actually the problem is, am not able to get the passing data on child component.
This is React.js custom app, Which has parent file index.html and child (modal.html)
Am using below interface method to trigger child (modal.html) component from parent component
client.interface.trigger('showModal', {
title: 'Sample Modal',
template: 'modal.html',
data: { firstName: 'John', lastName: 'Doe' },
})
And am trying to get the passed data on child component by below method
Note: I have added this code in app/modal.html → Inside script element
window?.client?.instance?.context().then(function (context) {
console.log('Passing-parameters', context);
})
-
I wasn’t not able to get the passed data in the child component. I was getting error “Client is not defined”.
Note: I have added this script on head ("https://static.freshdev.io/fdk/2.0/assets/fresh_client.js) -
I have tried to set the client on localStorage. But that doesn’t have context in it.