mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
addon render function are now called like React elements, thus keys are no longer needed.
This is not a breaking change, just logs a warning from react as far as i can see
This commit is contained in:
parent
36f4a7a1da
commit
9f79059cce
@ -36,8 +36,8 @@ addons.register(ADDON_ID, (api) => {
|
||||
addons.add(PANEL_ID, {
|
||||
title: Title,
|
||||
type: types.PANEL,
|
||||
render: ({ active = true, key }) => (
|
||||
<A11yContextProvider key={key} active={active}>
|
||||
render: ({ active = true }) => (
|
||||
<A11yContextProvider active={active}>
|
||||
<A11YPanel />
|
||||
</A11yContextProvider>
|
||||
),
|
||||
|
@ -36,7 +36,7 @@ addons.register(ADDON_ID, (api) => {
|
||||
addons.add(PANEL_ID, {
|
||||
title: Title,
|
||||
type: types.PANEL,
|
||||
render: ({ active, key }) => <ActionLogger key={key} api={api} active={!!active} />,
|
||||
render: ({ active }) => <ActionLogger api={api} active={!!active} />,
|
||||
paramKey: PARAM_KEY,
|
||||
});
|
||||
});
|
||||
|
@ -26,12 +26,12 @@ addons.register(ADDON_ID, (api) => {
|
||||
title: Title,
|
||||
type: types.PANEL,
|
||||
paramKey: PARAM_KEY,
|
||||
render: ({ key, active }) => {
|
||||
render: ({ active }) => {
|
||||
if (!active || !api.getCurrentStoryData()) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<AddonPanel key={key} active={active}>
|
||||
<AddonPanel active={active}>
|
||||
<ControlsPanel />
|
||||
</AddonPanel>
|
||||
);
|
||||
|
@ -29,7 +29,7 @@ addons.register(ADDON_ID, (api) => {
|
||||
type: types.PANEL,
|
||||
title: Title,
|
||||
match: ({ viewMode }) => viewMode === 'story',
|
||||
render: ({ key, active }) => {
|
||||
render: ({ active }) => {
|
||||
const newLocal = useCallback(({ state }: Combo) => {
|
||||
return {
|
||||
storyId: state.storyId,
|
||||
@ -37,7 +37,7 @@ addons.register(ADDON_ID, (api) => {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<AddonPanel key={key} active={active}>
|
||||
<AddonPanel active={active}>
|
||||
<Consumer filter={newLocal}>{({ storyId }) => <Panel storyId={storyId} />}</Consumer>
|
||||
</AddonPanel>
|
||||
);
|
||||
|
@ -8,7 +8,7 @@ addons.register(ADDON_ID, (api) => {
|
||||
addons.add(PANEL_ID, {
|
||||
title: 'Tests',
|
||||
type: types.PANEL,
|
||||
render: ({ active, key }) => <Panel key={key} api={api} active={active} />,
|
||||
render: ({ active }) => <Panel api={api} active={active} />,
|
||||
paramKey: PARAM_KEY,
|
||||
});
|
||||
});
|
||||
|
@ -8,7 +8,7 @@ addons.register(ADDON_ID, (api) => {
|
||||
addons.add(PANEL_ID, {
|
||||
type: types.PANEL,
|
||||
title: 'Code',
|
||||
render: ({ active, key }) => (active ? <StoryPanel key={key} api={api} /> : null),
|
||||
render: ({ active }) => (active ? <StoryPanel api={api} /> : null),
|
||||
paramKey: 'storysource',
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user