[addon-info] `No propTypes defined!` on prop table in build mode
See original GitHub issueMaybe this refers to this issues: https://github.com/storybooks/storybook/issues/1141
I will duplicate my last comment here:
PropTypes still not worked for me in build mode. Here my component:
import React from "react";
import "./Background.css";
import PropTypes from "prop-types";
const Background = (props) => {
const {children} = props;
return (
<div className={"Background"}>
{children}
</div>
)
};
Background.displayName = "Background";
Background.propTypes = {
/** My content */
children: PropTypes.any.isRequired
};
export default Background;
For command NODE_ENV=production npm run storybook
i have:
And for npm run storybook
:
Same for the rest of the components too. But when i added:
Background.defaultProps = {
children: 'my text'
};
the following happens:
I use:
"@storybook/addon-info": "4.1.2",
"@storybook/addon-knobs": "4.1.2",
"@storybook/addon-options": "4.1.2",
"@storybook/cli": "4.1.2",
"@storybook/react": "4.1.2",
is amazing
Am I doing something wrong?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:17 (2 by maintainers)
Top Results From Across the Web
[addon-info] `No propTypes defined!` on prop table in build ...
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please...
Read more >How to enable prop-types in production for a React Storybook ...
Storybook has an addon called Docs that detects the prop-types for components and creates a table of the prop-types for easy to read ......
Read more >@luke-john/react-docgen-typescript-loader - npm
Webpack loader to generate docgen information from TypeScript React components. The primary use case is to get the prop types table ...
Read more >react-docgen-typescript-loader - Bountysource
If a component uses a prop of an enum that is imported from another file, ... No propTypes defined! when using create-react-app and...
Read more >a component library with Storybook, Tailwind, and Typescript.
npx create-react-app storybook-ts --template typescript ... The info addon generates the source code and a proptypes table. Storybook.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
would really appreciate an update on this issue!
FYI
addon-info
is being superceded byaddon-docs
, which fixes a bunch of bugs and is easier to maintain. It’s reached release candidate (RC) status and will be properly released soon. Please give it a try! https://medium.com/storybookjs/storybook-docspage-e185bc3622bf