Datepickersingle returns nonetype

my callback keeps returning a NoneType whilst I have tried using strings and datetime as input.

@dash_app.callback(
    Output(component_id="forwardPrices", component_property="figure"),
    [Input(component_id="my-datetime-picker-single-tradeDateForwardPrices", component_property="trade_Date")],
    prevent_initial_call=False,
)
def update_output(trade_Date):
    return forwardsDashboard.forwardPrices(trade_Date)


dcc.DatePickerSingle(
  id='my-datetime-picker-single-tradeDateForwardPrices',
  # min_date_allowed=date(2019, 1, 1),
  # max_date_allowed=date.today() - datetime.timedelta(days=1),
  # initial_visible_month=date.today() - datetime.timedelta(days=1),
  date='2021/01/02'
  ),
dcc.Graph(id='forwardPrices'),

why does it keep returning None and what is there to do?

Hi @belewaut and welcome to the community !

The value of component_property inside your Input statement is not a valid component property of the DatePickerSingle.

Change it to:

@dash_app.callback(
    Output(component_id="forwardPrices", component_property="figure"),
    Input(component_id="my-datetime-picker-single-tradeDateForwardPrices", component_property="date"),
    prevent_initial_call=False,
)
def update_output(trade_Date)

The input parameter name for your update_output function could be anything (eg: “trade_Date”) but inside your callback definition component_property should be one of the properties from your component (eg: “children”, “value”, “date”)