Support 5.x by replacing call to .onStory() with .on(STORY_CHANGED, ... )
This commit is contained in:
parent
fcf7e93164
commit
52f8ac8a49
File diff suppressed because it is too large
Load Diff
|
@ -6,7 +6,8 @@
|
|||
"scripts": {
|
||||
"storybook": "start-storybook -p 9001 -c .storybook",
|
||||
"deploy-storybook": "storybook-to-ghpages",
|
||||
"transpile": "babel --plugins \"transform-runtime\" ./src --out-dir ."
|
||||
"transpile": "babel --plugins \"transform-runtime\" ./src --out-dir .",
|
||||
"transpile:watch": "babel --watch --plugins \"transform-runtime\" ./src --out-dir ."
|
||||
},
|
||||
"keywords": [
|
||||
"react",
|
||||
|
|
|
@ -28,6 +28,8 @@ var _addons = require('@storybook/addons');
|
|||
|
||||
var _addons2 = _interopRequireDefault(_addons);
|
||||
|
||||
var _coreEvents = require('@storybook/core-events');
|
||||
|
||||
var _reactSyntaxHighlighter = require('react-syntax-highlighter');
|
||||
|
||||
var _reactSyntaxHighlighter2 = _interopRequireDefault(_reactSyntaxHighlighter);
|
||||
|
@ -89,7 +91,7 @@ var StaticMarkup = function (_React$Component) {
|
|||
channel.on('evgenykochetkov/static-markup/show-markup', this.onShowStaticMarkup);
|
||||
|
||||
// Clear the current state on every story change.
|
||||
this.stopListeningOnStory = api.onStory(function () {
|
||||
this.stopListeningOnStory = api.on(_coreEvents.STORY_CHANGED, function () {
|
||||
_this2.onShowStaticMarkup('');
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import addons from '@storybook/addons';
|
||||
import { STORY_CHANGED } from '@storybook/core-events';
|
||||
import SyntaxHighlighter from 'react-syntax-highlighter';
|
||||
import { docco } from 'react-syntax-highlighter/dist/styles/hljs';
|
||||
const pretty = require('pretty');
|
||||
|
@ -36,7 +37,7 @@ class StaticMarkup extends React.Component {
|
|||
channel.on('evgenykochetkov/static-markup/show-markup', this.onShowStaticMarkup);
|
||||
|
||||
// Clear the current state on every story change.
|
||||
this.stopListeningOnStory = api.onStory(() => {
|
||||
this.stopListeningOnStory = api.on(STORY_CHANGED, () => {
|
||||
this.onShowStaticMarkup('');
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue