-
Type:
Suggestion
-
Resolution: Won't Fix
-
Component/s: Forge - App UI Web
UI Kit 1 had `accountType` in `userProductContext` hook and we were able to use it in UI Kit 1 like this.
import ForgeUI, { useProductContext, Text, Macro, render } from '@forge/ui'; const App = () => { const context = useProductContext(); return <Text>Account type: {context.accountType}</Text>; }; export const run = render(<Macro app={<App />} />);
However, UI Kit does not have `accountType` in `userProductContext` hook. This doesn't work.
import { useProductContext } from '@forge/bridge'; const App = () => { const context = useProductContext(); return <Text>Account type: {context.accountType}</Text>; };
Please add support for it. And, update the documentation
Workaround
For the time being, we can use backend to validate user accountType.
resolver.define('backendFunc', (req) => { console.log(req); // req.accountType exists return 'Hello, world!'; });