Skip to content

Commit

Permalink
Merge pull request #26202 from storybookjs/norbert/remove-deprecation…
Browse files Browse the repository at this point in the history
…-manager-api-types

Maintenance: Remove deprecation of `manager-api`'s `types` export
  • Loading branch information
ndelangen authored Feb 27, 2024
2 parents 01f25d7 + 6975de8 commit 670c58c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 2 additions & 5 deletions code/lib/manager-api/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,8 @@ export function useArgTypes(): ArgTypes {

export { addons } from './lib/addons';

/**
* We need to rename this so it's not compiled to a straight re-export
* Our globalization plugin can't handle an import and export of the same name in different lines
* @deprecated
*/
// We need to rename this so it's not compiled to a straight re-export
// Our globalization plugin can't handle an import and export of the same name in different lines
const typesX = types;

export { typesX as types };
Expand Down
7 changes: 6 additions & 1 deletion code/lib/types/src/modules/addons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,12 @@ export interface Addon_BaseType {
* This is called as a function, so if you want to use hooks,
* your function needs to return a JSX.Element within which components are rendered
*/
render: (renderOptions: Partial<Addon_RenderOptions>) => ReactElement<any, any> | null;
render: (props: Partial<Addon_RenderOptions>) => ReturnType<FC<Partial<Addon_RenderOptions>>>;
// TODO: for Storybook 9 I'd like to change this to be:
// render: FC<Partial<Addon_RenderOptions>>;
// This would bring it in line with how every other addon is set up.
// We'd need to change how the render function is called in the manager:
// https://github.com/storybookjs/storybook/blob/4e6fc0dde0842841d99cb3cf5148ca293a950301/code/ui/manager/src/components/preview/Preview.tsx#L105
/**
* @unstable
*/
Expand Down

0 comments on commit 670c58c

Please sign in to comment.