Version:
"@storybook/addon-knobs": "^3.2.15"
Usage:
stories
.add('scatter', () => {
const value = array('Data', measurements);
return <ScatterChart width={600} height={400} min={60} data={value}></ScatterChart>
})
measurements:
[
{
"high": 80,
"time": "03:30"
},
{
"high": 120,
"time": "07:00"
},
{
"high": 10,
"time": "12:45"
}
]
knob:

Expected:
To have the actual object representation and be able to interact with them via UI
Thx
This should be taken care of by https://github.com/storybooks/storybook/pull/1460 but the pull request appears to have been abandoned.
You can actually pass JSON-serializeable arrays to object knob, like this:
const value = object('Data', measurements);
@Hypnosphi Thx. It works now.
Most helpful comment
You can actually pass JSON-serializeable arrays to
objectknob, like this:1460 is for non-serializeable stuff like functions, which is not your case