diff --git a/code/renderers/react/src/docs/jsxDecorator.test.tsx b/code/renderers/react/src/docs/jsxDecorator.test.tsx index dbf6e53ffe31..57b1f3d4f61e 100644 --- a/code/renderers/react/src/docs/jsxDecorator.test.tsx +++ b/code/renderers/react/src/docs/jsxDecorator.test.tsx @@ -229,22 +229,6 @@ describe('jsxDecorator', () => { expect(mockChannel.emit).not.toHaveBeenCalled(); }); - // This is deprecated, but still test it - it('allows the snippet output to be modified by onBeforeRender', async () => { - const storyFn = (args: any) =>
${dom}
`; - const jsx = { onBeforeRender }; - const context = makeContext('args', { __isArgsStory: true, jsx }, {}); - jsxDecorator(storyFn, context); - await new Promise((r) => setTimeout(r, 0)); - - expect(mockChannel.emit).toHaveBeenCalledWith( - SNIPPET_RENDERED, - 'jsx-test--args', - '${dom}
`; diff --git a/code/renderers/react/src/docs/jsxDecorator.tsx b/code/renderers/react/src/docs/jsxDecorator.tsx index 64bed62bfd74..343c30de9d95 100644 --- a/code/renderers/react/src/docs/jsxDecorator.tsx +++ b/code/renderers/react/src/docs/jsxDecorator.tsx @@ -1,8 +1,6 @@ /* eslint-disable no-underscore-dangle */ import React, { createElement, ReactElement } from 'react'; import reactElementToJSXString, { Options } from 'react-element-to-jsx-string'; -import { dedent } from 'ts-dedent'; -import deprecate from 'util-deprecate'; import { addons, useEffect } from '@storybook/addons'; import { StoryContext, ArgsStoryFn, PartialStoryFn } from '@storybook/csf'; @@ -22,30 +20,10 @@ type JSXOptions = Options & { enableBeautify?: boolean; /** Override the display name used for a component */ displayName?: string | Options['displayName']; - /** Deprecated: A function ran after the story is rendered */ - onBeforeRender?(dom: string): string; - /** A function ran after a story is rendered (prefer this over `onBeforeRender`) */ + /** A function ran after a story is rendered */ transformSource?(dom: string, context?: StoryContext