Storybook: 3.0.0> 3.1.6์€ ์• ๋“œ์˜จ์„ ์ค‘๋‹จํ•˜๊ณ  'channel'์€ null์ž…๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2017๋…„ 06์›” 28์ผ  ยท  2์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: storybookjs/storybook

๊ฐ„๋‹จํ•œ ์—…๊ทธ๋ ˆ์ด๋“œ๋กœ ์ธํ•ด ์˜ต์…˜ ๋ฐ ๋…ธ๋ธŒ ์• ๋“œ์˜จ๊ณผ ๊ฐ™์€ ์• ๋“œ์˜จ์ด ์ž‘๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ฒฐ๊ณผ ์˜ˆ์™ธ๋กœ ์ธํ•ด ์Šคํ† ๋ฆฌ ๋ถ์ด ์‹คํ–‰๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

'์• ๋“œ์˜จ ์ฑ„๋„'์ด null ์ธ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

render.js:65 TypeError: Cannot read property 'removeListener' of null
    at WrapStory.componentWillUnmount (WrapStory.js:76)
    at ReactCompositeComponent.js:408
    at measureLifeCyclePerf (ReactCompositeComponent.js:75)
    at ReactCompositeComponentWrapper.unmountComponent (ReactCompositeComponent.js:407)
    at Object.unmountComponent (ReactReconciler.js:78)
    at Object.unmountChildren (ReactChildReconciler.js:146)
    at ReactDOMComponent.unmountChildren (ReactMultiChild.js:371)
    at ReactDOMComponent.unmountComponent (ReactDOMComponent.js:990)
    at Object.unmountComponent (ReactReconciler.js:78)
    at ReactCompositeComponentWrapper.unmountComponent (ReactCompositeComponent.js:417)

์ด๊ฒƒ์€ ๋‹ค์Œ์„ ์ฐธ์กฐํ•˜๋Š” ๋ผ์ธ์ž…๋‹ˆ๋‹ค.

this.props.channel.removeListener('addon:knobs:knobChange', this.knobChanged);

๊ทธ๋ฆฌ๊ณ  config.js :

import { configure, addDecorator } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';
import Global from '../src/components/Global';

const req = require.context('../src/components', true, /.stories.js$/);

function loadStories() {
    req.keys().forEach(filename => req(filename));
}

addDecorator(story => (
    <Global>
        {story()}
    </Global>
));

addDecorator(withKnobs);

configure(loadStories, module);

์Šคํ† ๋ฆฌ ์ž์ฒด์— withKnobs ํ˜ธ์ถœ์„ ์ถ”๊ฐ€ํ•˜๋ ค๊ณ ํ–ˆ์ง€๋งŒ ์•„๋ฌด๋Ÿฐ ์ฐจ์ด๊ฐ€ ์—†์—ˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ withKnobs๋ฅผ ํ˜ธ์ถœํ•˜๊ธฐ ์ „์— setTimeout์„ ์ถ”๊ฐ€ํ•ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค.

storiesOf('My Story', module)
    .addDecorator(withKnobs)

์ •์ƒ์ ์œผ๋กœ ์ž‘๋™ํ•˜์ง€๋งŒ ๋ช…ํ™•ํ•œ ํ˜ธ์ถœ์„ ์ฐพ์„ ์ˆ˜์—†๋Š” 3.0.0์œผ๋กœ ๋‹ค์‹œ ๋‹ค์šด ๊ทธ๋ ˆ์ด๋“œ ํ•  ์˜ˆ์ •์ด์ง€๋งŒ ์ตœ๊ทผ์— ์Šคํ† ๋ฆฌ ๋ถ์— ๋งŽ์€ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

knobs options question / support

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

@shilman ์—๊ฒŒ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๋‹น์‹ ์ด ์“ด๋Œ€๋กœ ๊ทธ๋ ‡๊ฒŒํ•˜๊ณ 

์˜ค๋Š˜ ๋„์›€๊ณผ ๋น ๋ฅธ ์‘๋‹ต์— ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค! ๐Ÿ™Œ๐Ÿป

๋ชจ๋“  2 ๋Œ“๊ธ€

@samkelleher ์‚ฌ๋žŒ๋“ค์˜ npm ์„ค์ •์— ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์šด ๊ทธ๋ ˆ์ด๋“œํ•˜๊ธฐ ์ „์— node_modules ์„ ์ •๋ฆฌํ•˜๊ณ  ์ƒˆ๋กœ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

ํŽธ์ง‘ : ๋˜ํ•œ ์›์‚ฌ / npm ์ž ๊ธˆ ํŒŒ์ผ์ด ์žˆ์œผ๋ฉด ์„ค์น˜ํ•˜๊ธฐ ์ „์— nuking์„ ์‹œ๋„ํ•˜์‹ญ์‹œ์˜ค.

@shilman ์—๊ฒŒ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๋‹น์‹ ์ด ์“ด๋Œ€๋กœ ๊ทธ๋ ‡๊ฒŒํ•˜๊ณ 

์˜ค๋Š˜ ๋„์›€๊ณผ ๋น ๋ฅธ ์‘๋‹ต์— ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค! ๐Ÿ™Œ๐Ÿป

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰