{"action":"created","issue":{"url":"https://api.github.com/repos/storybooks/storybook/issues/4059","repository_url":"https://api.github.com/repos/storybooks/storybook","labels_url":"https://api.github.com/repos/storybooks/storybook/issues/4059/labels{/name}","comments_url":"https://api.github.com/repos/storybooks/storybook/issues/4059/comments","events_url":"https://api.github.com/repos/storybooks/storybook/issues/4059/events","html_url":"https://github.com/storybooks/storybook/issues/4059","id":353155558,"node_id":"MDU6SXNzdWUzNTMxNTU1NTg=","number":4059,"title":"Knobs + Object Props & re-initialization of component","user":{"login":"yangwen2","id":2554783,"node_id":"MDQ6VXNlcjI1NTQ3ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/2554783?v=4","gravatar_id":"","url":"https://api.github.com/users/yangwen2","html_url":"https://github.com/yangwen2","followers_url":"https://api.github.com/users/yangwen2/followers","following_url":"https://api.github.com/users/yangwen2/following{/other_user}","gists_url":"https://api.github.com/users/yangwen2/gists{/gist_id}","starred_url":"https://api.github.com/users/yangwen2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yangwen2/subscriptions","organizations_url":"https://api.github.com/users/yangwen2/orgs","repos_url":"https://api.github.com/users/yangwen2/repos","events_url":"https://api.github.com/users/yangwen2/events{/privacy}","received_events_url":"https://api.github.com/users/yangwen2/received_events","type":"User","site_admin":false},"labels":[{"id":584803996,"node_id":"MDU6TGFiZWw1ODQ4MDM5OTY=","url":"https://api.github.com/repos/storybooks/storybook/labels/addon:%20knobs","name":"addon: knobs","color":"fbca04","default":false},{"id":642055226,"node_id":"MDU6TGFiZWw2NDIwNTUyMjY=","url":"https://api.github.com/repos/storybooks/storybook/labels/app:%20angular","name":"app: angular","color":"f9d0c4","default":false},{"id":735933332,"node_id":"MDU6TGFiZWw3MzU5MzMzMzI=","url":"https://api.github.com/repos/storybooks/storybook/labels/inactive","name":"inactive","color":"ffffff","default":false},{"id":343576459,"node_id":"MDU6TGFiZWwzNDM1NzY0NTk=","url":"https://api.github.com/repos/storybooks/storybook/labels/question%20/%20support","name":"question / support","color":"cc317c","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-08-22T22:53:48Z","updated_at":"2018-12-11T21:14:07Z","closed_at":"2018-12-02T18:46:15Z","author_association":"NONE","body":"So I'm using storybook with Angular.  Knobs works great when the inputs to the component are primitives.  The component's default change detection takes over and the component re-renders with the new values accordingly.\r\n\r\nHowever when dealing with objects as prop, mutating the prop via knobs doesn't update the component.  This is to be expected, because the component in question likely does not recognize a change in the prop due to the data mutation.\r\n\r\nWhat I really need, is for storybook to re-initialize the component with the latest prop value that I've supplied via knob. For example - I have a chart component that accepts an input object that describes the colors and other attributes for the chart.  When I tweak these settings via Knobs, I would like for the component to be re-initialized with the new values I've set via Knobs. \r\n\r\nI noticed that when I update the prop via Knobs, the deep URL gets updated with a parameter 'knob-options', which is set to the serialized value of the prop.  Is this used for something?  Is what I described above doable with  Knobs?"},"comment":{"url":"https://api.github.com/repos/storybooks/storybook/issues/comments/446364198","html_url":"https://github.com/storybooks/storybook/issues/4059#issuecomment-446364198","issue_url":"https://api.github.com/repos/storybooks/storybook/issues/4059","id":446364198,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjM2NDE5OA==","user":{"login":"igor-dv","id":7867954,"node_id":"MDQ6VXNlcjc4Njc5NTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7867954?v=4","gravatar_id":"","url":"https://api.github.com/users/igor-dv","html_url":"https://github.com/igor-dv","followers_url":"https://api.github.com/users/igor-dv/followers","following_url":"https://api.github.com/users/igor-dv/following{/other_user}","gists_url":"https://api.github.com/users/igor-dv/gists{/gist_id}","starred_url":"https://api.github.com/users/igor-dv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igor-dv/subscriptions","organizations_url":"https://api.github.com/users/igor-dv/orgs","repos_url":"https://api.github.com/users/igor-dv/repos","events_url":"https://api.github.com/users/igor-dv/events{/privacy}","received_events_url":"https://api.github.com/users/igor-dv/received_events","type":"User","site_admin":false},"created_at":"2018-12-11T21:14:07Z","updated_at":"2018-12-11T21:14:07Z","author_association":"MEMBER","body":"You should define knobs in the story function. Or change `cardProps` to something like:\r\n```js\r\nconst cardProps = () => {\r\n  client: text(\"client\", \"ClientNameHere\"),\r\n   ...\r\n};\r\n```"}}
{"actor":{"display_login":"igor-dv"}}