1

I'm trying to minimize the amount of REST calls in my app by using the data once received all over the app. I can successfully pass each of the properties in the JSON file as props, but what I want is to send the whole object at once.

Following is the code I'm using to push the the page and the props.

itemClicked: function (id, name, description, item) {
    this.props.navigator.push({
        title: "View Page",
        component: ViewPage,
        passProps: { id: id, name: name, description: description, item: item },
    });
}

The passed props id, name and description works perfectly. But item (The object) doesn't seem to function like a normal JSON object. But if you print the whole object itself, it'll print the all of the content. Still, you can't access each of those individually.

How to do this properly? Thanks in advance.

Aditya Vyas-Lakhan
  • 13,409
  • 16
  • 61
  • 96
Nimila Hiranya
  • 4,842
  • 10
  • 35
  • 52

0 Answers0