Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance: Remove deprecation of manager-api's types export #26202

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading