I’m trying to use examples from the documentation but the examples no longer work without extensive component definition. In checklist documentation this is given as the first exapmle:
dcc.Checklist(['New York City', 'Montreal', 'San Francisco'], 'Montreal')
But results in
Exception has occurred: TypeError
`id` prop must be a string or dict, not ['New York City', 'Montreal', 'San Francisco']
Even if I define the component attributes:
checklist1 = dcc.Checklist(id="checklist1", options=['New York City', 'Montreal', 'San Francisco'], value='Montreal')
I don’t see the options listed in my app:
However, this code works fine:
checklist1 = dcc.Checklist(
options=[
{'label': 'New York City', 'value': 'New York City'},
{'label': 'Montreal', 'value': 'Montreal'},
{'label': 'San Francisco', 'value': 'San Francisco'},
],
value='Montreal'
)
So to use a valid checklist requires manually defining the label and value of each entry which is tedious and harder when I’m trying to teach beginners.
Any suggestions? I filed a bug report