Skip to content

Commit

Permalink
fix(react): error in react/storybook
Browse files Browse the repository at this point in the history
This fixes the following problems:

- "TypeError: Cannot read properties of undefined" occurred in Renderer.stories.js
- docs.autodocs setting that was added by `npx storybook@latest upgrade` in PR #1419 is not needed and commented out.
  • Loading branch information
MurakamiShinyu committed Nov 17, 2024
1 parent e26e9fb commit 2a86d2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/react/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ module.exports = {
"@storybook/addon-actions",
"@storybook/addon-links",
"@storybook/addon-knobs",
"@storybook/addon-docs",
// "@storybook/addon-docs",
],

framework: {
name: "@storybook/react-webpack5",
options: {},
},

docs: {
autodocs: true,
},
// docs: {
// autodocs: true,
// },
};
11 changes: 9 additions & 2 deletions packages/react/src/stories/Renderer.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import React from "react";
import { action } from "@storybook/addon-actions";
import { withKnobs, text, boolean, number, color, select } from "@storybook/addon-knobs";
import {
withKnobs,
text,
boolean,
number,
color,
select,
} from "@storybook/addon-knobs";

import { Renderer } from "../renderer";

Expand Down Expand Up @@ -87,7 +94,7 @@ export const Narrowed = () => (
onLoad={action("loaded")}
onError={action("error")}
onNavigation={action("navigation")}
onMessage={(msg, type) => action("message")(type, msg.messages[0])}
onMessage={(msg, type) => action("message")(type, msg)}
onReadyStateChange={action("readyStateChange")}
onHyperlink={action("hyperlink")}
/>
Expand Down

0 comments on commit 2a86d2c

Please sign in to comment.