import { object } from '@storybook/addon-knobs/angular' throw error
See original GitHub issueDescribe the bug
When using import { object } from '@storybook/addon-knobs/angular';
and creating an object (for example: ), the following error is outputting to the console.
Warning: `ObjectType` uses `getDerivedStateFromProps` but its initial state is undefined. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `ObjectType`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.
To Reproduce
- Import object from ‘@storybook/addon-knobs/angular’
- create a new object
- run storybook
- See the error in the console
Expected behavior there shouldn’t be any error.
System:
- OS:MacOS
- Device: Macbook Pro 2018
- Browser: chrome
- Framework: angular
- Addons: [ knobs ]
- Version: 4.1.6
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:10 (3 by maintainers)
Top Results From Across the Web
import { object } from '@storybook/addon-knobs/angular' throw ...
I have the same error ( importing { object } from @storybook/addon-knobs of version 4.0.9) in development mode. Clearly, ObjectType component ...
Read more >Knobs Addon | Storybook: Frontend workshop for UI ...
Storybook Addon Knobs allow you to edit props dynamically using the Storybook ... import { storiesOf } from '@storybook/angular'; import { boolean, number, ......
Read more >React Storybook addon Knobs for editing Angular props
Storybook Addon Knobs allow you to edit React props dynamically using the Storybook UI. You can also use Knobs as a dynamic variable...
Read more >@storybook/addon-controls - npm
Auto-generate controls based on React/Vue/Angular/etc. components. Portable. ... Import stories directly into your Jest tests. Ecosystem.
Read more >storybook/addon-knobs/README.md - UNPKG
Storybook Addon Knobs allow you to edit React props dynamically using the Storybook UI. 4, You can also use Knobs as a dynamic...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am also mess the same trouble, but with React.
I have the same error ( importing
{ object }
from@storybook/addon-knobs
of version 4.0.9) in development mode. Clearly, ObjectType component does not have initial state.