reflex-dev/reflex · error · TypeError

`{definition.python_name}` does not accept prop `{unexpected

Error message

`{definition.python_name}` does not accept prop `{unexpected_prop}`. Only declared props may be passed when no `rx.RestProp` is present.

What it means

An unknown keyword prop was passed to a memoized function via `.call()`/`partial`, and the function does not declare an `rx.RestProp` parameter. Without a rest prop, only explicitly declared parameters are accepted.

Source

Thrown at packages/reflex-base/src/reflex_base/components/memo.py:1579

    explicit_values = {}
    remaining_props = kwargs.copy()
    for param in explicit_params:
        if param.name in remaining_props:
            explicit_values[param.name] = remaining_props.pop(param.name)
        elif param.default is not inspect.Parameter.empty:
            explicit_values[param.name] = param.default
        else:
            msg = f"`{definition.python_name}` is missing required prop `{param.name}`."
            raise TypeError(msg)

    # Reject unknown props unless a rest prop is declared.
    if remaining_props and rest_param is None:
        unexpected_prop = next(iter(remaining_props))
        msg = (
            f"`{definition.python_name}` does not accept prop `{unexpected_prop}`. "
            "Only declared props may be passed when no `rx.RestProp` is present."
        )
        raise TypeError(msg)

    # Return ordered explicit args when no packed props object is needed.
    if children_param is None and rest_param is None:
        return tuple(explicit_values[param.name] for param in explicit_params)

    # Build the props object passed to the imported FunctionVar.
    children_value: Any | None = None
    if children_param is not None:
        from reflex_components_core.base.fragment import Fragment

        children_value = args[0] if len(args) == 1 else Fragment.create(*args)

    # Convert rest-prop keys to camelCase to match component memo behavior.
    camel_cased_remaining_props = {
        format.to_camel_case(key): value for key, value in remaining_props.items()
    }

    bound_props = {}

View on GitHub (pinned to 45b8ed5ab7)

Solutions

  1. Remove the unknown prop from the call, or rename it to a declared parameter
  2. Add a `**rest: rx.RestProp` parameter to the memo function if it should accept arbitrary extra props
  3. Check the function signature for the exact set of declared props

Example fix

// before
@rx.memo
def card(title: str) -> rx.Component: ...
card.call(title="x", onClick=handler)

// after
@rx.memo
def card(title: str, **rest: rx.RestProp) -> rx.Component: ...
card.call(title="x", onClick=handler)
Defensive patterns

Strategy: validation

Validate before calling

import inspect

def prune_extra_props(fn, props: dict) -> dict:
    declared = set(inspect.signature(fn).parameters)
    return {k: v for k, v in props.items() if k in declared}

card.call(**prune_extra_props(card, incoming_props))

Prevention

When it happens

Trigger: Passing `extra=something` when the memo function signature has no `**rest: rx.RestProp` parameter; common after renaming a prop or forwarding a props dict.

Common situations: Spreading a parent's props into a memo that only accepts a subset, stale prop names after a refactor, or HTML-style attribute passing to a memo that does not forward rest props.

Related errors


AI-assisted analysis of reflex-dev/reflex@45b8ed5ab7 (2026-08-28). Data as JSON: /api/errors/979aa58589e3c3cd. Report an issue: GitHub.