Skip to content

Commit f678822

Browse files
authored
docs: fix accessing metadata for usePluginComponents (#2725)
1 parent 05024a2 commit f678822

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

docusaurus/docs/how-to-guides/ui-extensions/extension-user-render-component.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export const InstanceToolbar = () => {
5050
return (
5151
<div>
5252
{/* Loop through the components added by plugins */}
53-
{components.map(({ id, component: Component }) => (
54-
<Component key={id} />
53+
{components.map((Component) => (
54+
<Component key={Component.meta.id} />
5555
))}
5656
</div>
5757
);
@@ -96,8 +96,8 @@ export const InstanceToolbar = ({ instanceId }) => {
9696
return (
9797
<div>
9898
{/* Sharing contextual information using component props */}
99-
{components.map(({ id, component: Component }) => (
100-
<Component key={id} instanceId={instanceId} />
99+
{components.map((Component) => (
100+
<Component key={Component.meta.id} instanceId={instanceId} />
101101
))}
102102
</div>
103103
);
@@ -138,7 +138,7 @@ export const InstanceToolbar = () => {
138138
// that has registered the extension.
139139
const allowedComponents = useMemo(() => {
140140
const allowedPluginIds = ['myorg-a-app', 'myorg-b-app'];
141-
return components.filter(({ pluginId }) => allowedPluginIds.includes(pluginId));
141+
return components.filter((Component) => allowedPluginIds.includes(Component.meta.pluginId));
142142
}, [components]);
143143

144144
// ...

0 commit comments

Comments
 (0)