Skip to content

Commit

Permalink
Merge pull request #1725 from storybooks/dd/docgen-static
Browse files Browse the repository at this point in the history
Fix Docgen in static builds for Info
  • Loading branch information
danielduan authored Aug 28, 2017
2 parents a1e6ab7 + 0eb71b9 commit 6f5b71c
Show file tree
Hide file tree
Showing 4 changed files with 505 additions and 4 deletions.
6 changes: 6 additions & 0 deletions app/react/src/server/config/babel.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ module.exports = {
require.resolve('babel-preset-minify'),
],
plugins: [
[
require.resolve('babel-plugin-react-docgen'),
{
DOC_GEN_COLLECTION_NAME: 'STORYBOOK_REACT_CLASSES',
},
],
require.resolve('babel-plugin-transform-regenerator'),
[
require.resolve('babel-plugin-transform-runtime'),
Expand Down
14 changes: 14 additions & 0 deletions examples/cra-kitchen-sink/src/components/ImportedPropsButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import DocgenButton from './DocgenButton';

/** Button component description */
const ImportedPropsButton = ({ disabled, label, onClick }) =>
<button disabled={disabled} onClick={onClick}>
{label}
</button>;

ImportedPropsButton.defaultProps = DocgenButton.defaultProps;

ImportedPropsButton.propTypes = DocgenButton.propTypes;

export default ImportedPropsButton;
Loading

0 comments on commit 6f5b71c

Please sign in to comment.