logs messages on the story panel (#123)

* ref: https://github.com/storybooks/storybook-addon-console
This commit is contained in:
chunming 2017-10-29 01:01:03 -05:00 committed by Allen
parent 974f129aad
commit ca02af3d6a
3 changed files with 7 additions and 0 deletions

View File

@ -2,3 +2,4 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-console';

View File

@ -1,6 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
import React from 'react';
import { configure, addDecorator } from '@storybook/react';
import { withConsole } from '@storybook/addon-console';
function loadStories() {
require('stories');
@ -16,6 +17,10 @@ const componentDecorator = (story) => (
</div>
);
// prepend the story name to log messages
addDecorator((storyFn, context) => withConsole()(storyFn)(context));
addDecorator(componentDecorator);
configure(loadStories, module);

View File

@ -20,6 +20,7 @@
"react-bootstrap-table2": "0.0.1"
},
"devDependencies": {
"@storybook/addon-console": "^1.0.0",
"@storybook/react": "^3.2.8",
"react-redux": "^5.0.6",
"redux": "^3.7.2",