Please I need Urgent help. I save data to Storage as follows.
await storage.set('key1', {name: 'rahul', email: 'rahul@gmail.com' });
await storage.set('key1', {name: 'vasu', email: 'vasu@gmail.com' });
Here is my Issue.
Please how do I loop or map through the Stored data and render/displayed them within the Fragment components Eg. here
<Fragment>
// Map the stored data here
<Text>Display Records from storage</Text>
</Fragment>
This is my coding so far. can someone help me with a working code please
import api, { route } from "@forge/api";
import ForgeUI, { render, Fragment, Text, IssuePanel, useProductContext, useState, Component} from "@forge/ui";
import { storage, fetch } from '@forge/api';
const App = () => {
await storage.set('key1', {name: 'rahul', email: 'rahul@gmail.com' });
await storage.set('key1', {name: 'vasu', email: 'vasu@gmail.com' });
const result = await storage.get('key1');
return result;
return (
<Fragment>
// Map the stored data here
<Text>Display Records from storage</Text>
</Fragment>
);
};
export const run = render(
<IssuePanel>
<App />
</IssuePanel>
);
Thanks