I am trying to use checklists but I keep getting errors. I first tried adding
dcc.Checklist(['New York City', 'Montréal', 'San Francisco'], ['Montréal', 'San Francisco'])
and the page in my local server stops rendering. I get the error
TypeError:
id prop must be a string or dict, not ['New York City', 'Montréal', 'San Francisco']
.
So I add labels, such as
dcc.Checklist(options = ['New York City', 'Montréal', 'San Francisco'], value = ['Montréal', 'San Francisco'])
.
Now the page renders but I get the error:
Invalid argument `options[0]` passed into Checklist.
Expected `object`.
Was supplied type `string`.
I then tried it in a separate py script with the code exactly as it is in the dcc documentation and I’m still getting these errors.
from dash import Dash, dcc, html
app = Dash(__name__)
app.layout = html.Div([
dcc.Checklist(options = ['New York City', 'Montréal', 'San Francisco'],
value = ['Montréal', 'San Francisco'])
])
if __name__ == '__main__':
app.run_server(debug=True)
Does anyone know what’s going on? I’ve cleared my cookies and cache. I’ve done hard reloads, and restarted my computer, so I don’t think it’s anything on my end, but I could be wrong. Thanks!