feat: Add on mode init hook (#3882)
This commit is contained in:
parent
5a1cb842f0
commit
f58725ce40
@ -124,6 +124,15 @@ export default function ModeRoute({
|
||||
const params = useParams();
|
||||
// The URL's query search parameters where the keys casing is maintained
|
||||
const query = useSearchParams();
|
||||
|
||||
mode?.onModeInit?.({
|
||||
servicesManager,
|
||||
extensionManager,
|
||||
commandsManager,
|
||||
appConfig,
|
||||
query,
|
||||
});
|
||||
|
||||
// The URL's query search parameters where the keys are all lower case.
|
||||
const lowerCaseSearchParams = useSearchParams({ lowerCaseKeys: true });
|
||||
|
||||
@ -341,6 +350,7 @@ export default function ModeRoute({
|
||||
servicesManager,
|
||||
extensionManager,
|
||||
commandsManager,
|
||||
appConfig,
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@ -9,9 +9,18 @@ sidebar_label: Lifecycle Hooks
|
||||
|
||||
Currently, there are two hooks that are called for modes:
|
||||
|
||||
- onModeInit
|
||||
- onModeEnter
|
||||
- onModeExit
|
||||
|
||||
## onModeInit
|
||||
|
||||
This hook gets run before the defined route has been entered by the mode. This
|
||||
hook can be used for initialization before the first render.
|
||||
|
||||
This is called before `onModeEnter` calls. This allows modes to add or activate their own
|
||||
data sources and configuration before entering the mode (pre registrations).
|
||||
|
||||
## onModeEnter
|
||||
|
||||
This hook gets run after the defined route has been entered by the mode. This
|
||||
|
||||
Loading…
Reference in New Issue
Block a user