question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[addon-info] `No propTypes defined!` on prop table in build mode

See original GitHub issue

Maybe 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: 2019-01-15 18 33 02

And for npm run storybook: 2019-01-15 18 37 47

Same for the rest of the components too. But when i added:

Background.defaultProps = {
	children: 'my text'
};

the following happens: 2019-01-15 18 43 25

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:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tuhinadasguptacommented, Jun 25, 2019

would really appreciate an update on this issue!

1reaction
shilmancommented, Aug 26, 2019

FYI addon-info is being superceded by addon-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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found