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

[Bug]: Support for defaultProps will be removed from function components in a future major release. #24305

Closed
ecoms-ye opened this issue Sep 26, 2023 · 2 comments · Fixed by #24506 or #25619

Comments

@ecoms-ye
Copy link

ecoms-ye commented Sep 26, 2023

Describe the bug

Some built-in components like <Stories> and <Link2> would trigger this console error from react:

Warning: Stories: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at Stories (http://localhost:6006/vendors-node_modules_pnpm_storybook_blocks_7_4_5__types_react-dom_18_2_7__types_react_18_2_22-0a8250.iframe.bundle.js:493:1011)
    at DocsPage (http://localhost:6006/vendors-node_modules_pnpm_storybook_blocks_7_4_5__types_react-dom_18_2_7__types_react_18_2_22-0a8250.iframe.bundle.js:493:1730)
    at div
    at http://localhost:6006/vendors-node_modules_pnpm_storybook_blocks_7_4_5__types_react-dom_18_2_7__types_react_18_2_22-0a8250.iframe.bundle.js:1527:2994
    at div
    at http://localhost:6006/vendors-node_modules_pnpm_storybook_blocks_7_4_5__types_react-dom_18_2_7__types_react_18_2_22-0a8250.iframe.bundle.js:1527:2994
    at DocsPageWrapper (http://localhost:6006/vendors-node_modules_pnpm_storybook_blocks_7_4_5__types_react-dom_18_2_7__types_react_18_2_22-0a8250.iframe.bundle.js:413:10296)
    at ThemeProvider (http://localhost:6006/vendors-node_modules_pnpm_storybook_blocks_7_4_5__types_react-dom_18_2_7__types_react_18_2_22-0a8250.iframe.bundle.js:1527:3996)
    at SourceContainer (http://localhost:6006/vendors-node_modules_pnpm_storybook_blocks_7_4_5__types_react-dom_18_2_7__types_react_18_2_22-0a8250.iframe.bundle.js:434:1566)
    at DocsContainer (http://localhost:6006/vendors-node_modules_pnpm_storybook_blocks_7_4_5__types_react-dom_18_2_7__types_react_18_2_22-0a8250.iframe.bundle.js:491:6335)
    at Docs (http://localhost:6006/vendors-node_modules_pnpm_storybook_blocks_7_4_5__types_react-dom_18_2_7__types_react_18_2_22-0a8250.iframe.bundle.js:493:2565)
    at MDXProvider (http://localhost:6006/node_modules_pnpm_mdx-js_react_2_3_0_react_18_2_0_node_modules_mdx-js_react_index_js.iframe.bundle.js:127:23)
    at ErrorBoundary (http://localhost:6006/node_modules_pnpm_storybook_addon-docs_7_4_5__types_react-dom_18_2_7__types_react_18_2_22_rea-e406c9.iframe.bundle.js:40:300)
    at WithCallback (http://localhost:6006/vendors-node_modules_pnpm_babel_runtime_7_22_15_node_modules_babel_runtime_helpers_esm_extend-a21569.iframe.bundle.js:2740:34)

To Reproduce

Creat a autodoc page with multiple stories (<Stories>) or a component without args (<Link2>)

image

System

Environment Info:

  System:
    OS: macOS 13.5.2
  Binaries:
    Node: 18.18.0
    pnpm: 8.7.6
  Browsers:
    Chrome: 117.0.5938.62
  npmPackages:
    @storybook/addon-essentials: 7.4.5 => 7.4.5
    @storybook/addon-interactions: 7.4.5 => 7.4.5
    @storybook/addon-links: 7.4.5 => 7.4.5
    @storybook/blocks: 7.4.5 => 7.4.5
    @storybook/nextjs: 7.4.5 => 7.4.5
    @storybook/react: 7.4.5 => 7.4.5
    @storybook/testing-library: 0.2.1 => 0.2.1

Additional context

It seems didn't see this error massage last week

@ananddoesembed
Copy link

Any update?

WouterK12 pushed a commit to WouterK12/storybook that referenced this issue Oct 18, 2023
WouterK12 added a commit to WouterK12/storybook that referenced this issue Oct 18, 2023
WouterK12 added a commit to WouterK12/storybook that referenced this issue Oct 18, 2023
@fabpico
Copy link

fabpico commented Jan 9, 2024

Reopen, Link2 error still happens in Storybook 7.6.7. In the linked merge #24506, just Stories.tsx was addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
4 participants