useExtension
The useExtension
hook allows you to access information about the current account and the extension point in which your extension is running.
Usage
import { useExtension } from '@vtex/sales-app';
const ExtensionInfo = () => { const { account, extensionPoint } = useExtension();
return ( <div> <p>Account: {account}</p> <p>Extension Point: {extensionPoint}</p> </div> );};
Parameters
The useExtension
hook does not receive any parameters.
Returns
The useExtension
hook returns an object with the following structure:
account
- type:
string
- description: The current account name where the extension is running.
extensionPoint
- type:
ExtensionPointsType
- description: The name of extension point where your extension is hooked into.