For this code, what is module
? and what can you do with it?
storiesOf('Button', module)
.add('with text', () => (
<Button onClick={action('clicked')}>Hello Button</Button>
))
A colleague at my workplace has suggested that module
relates to the ES5 export syntax module.exports
.
that's indeed it @elisechant !
Storybook needs a reference to the file/module where your story-code is int to enable hpt-module-replacement.
If you do not supply it, you'd need to refresh your browser for every change you make to your component & story code.
I hope this helps!
(please re-open if your have further questions)
How we overcome the ESLint error that 'module' is not defined
?
https://eslint.org/docs/user-guide/configuring#specifying-environments
You tell eslint that the code will run in node and it should recognised that module
exists.
alternatively this is a solution too:
https://stackoverflow.com/questions/39053562/eslint-no-undef-and-webpack-plugin
thanks @ndelangen
adding following to my eslintrc file worked for me
"env": {
"browser": true,
"node": true
}
Most helpful comment
that's indeed it @elisechant !
Storybook needs a reference to the file/module where your story-code is int to enable hpt-module-replacement.
If you do not supply it, you'd need to refresh your browser for every change you make to your component & story code.
I hope this helps!
(please re-open if your have further questions)