question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

import { object } from '@storybook/addon-knobs/angular' throw error

See original GitHub issue

Describe 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

  1. Import object from ‘@storybook/addon-knobs/angular’
  2. create a new object
  3. run storybook
  4. 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:closed
  • Created 5 years ago
  • Reactions:12
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
IvanGrimescommented, Jan 21, 2019

I am also mess the same trouble, but with React.

3reactions
alinkeddcommented, Jan 17, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found