{"record":{"id":"979aa58589e3c3cd","repo":"reflex-dev/reflex","slug":"definition-python-name-does-not-accept-prop","errorCode":null,"errorMessage":"`{definition.python_name}` does not accept prop `{unexpected_prop}`. Only declared props may be passed when no `rx.RestProp` is present.","messagePattern":"`(.+?)` does not accept prop `(.+?)`\\. Only declared props may be passed when no `rx\\.RestProp` is present\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/reflex-base/src/reflex_base/components/memo.py","lineNumber":1579,"sourceCode":"    explicit_values = {}\n    remaining_props = kwargs.copy()\n    for param in explicit_params:\n        if param.name in remaining_props:\n            explicit_values[param.name] = remaining_props.pop(param.name)\n        elif param.default is not inspect.Parameter.empty:\n            explicit_values[param.name] = param.default\n        else:\n            msg = f\"`{definition.python_name}` is missing required prop `{param.name}`.\"\n            raise TypeError(msg)\n\n    # Reject unknown props unless a rest prop is declared.\n    if remaining_props and rest_param is None:\n        unexpected_prop = next(iter(remaining_props))\n        msg = (\n            f\"`{definition.python_name}` does not accept prop `{unexpected_prop}`. \"\n            \"Only declared props may be passed when no `rx.RestProp` is present.\"\n        )\n        raise TypeError(msg)\n\n    # Return ordered explicit args when no packed props object is needed.\n    if children_param is None and rest_param is None:\n        return tuple(explicit_values[param.name] for param in explicit_params)\n\n    # Build the props object passed to the imported FunctionVar.\n    children_value: Any | None = None\n    if children_param is not None:\n        from reflex_components_core.base.fragment import Fragment\n\n        children_value = args[0] if len(args) == 1 else Fragment.create(*args)\n\n    # Convert rest-prop keys to camelCase to match component memo behavior.\n    camel_cased_remaining_props = {\n        format.to_camel_case(key): value for key, value in remaining_props.items()\n    }\n\n    bound_props = {}","sourceCodeStart":1561,"sourceCodeEnd":1597,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/components/memo.py#L1561-L1597","documentation":"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.","triggerScenarios":"Passing `extra=something` when the memo function signature has no `**rest: rx.RestProp` parameter; common after renaming a prop or forwarding a props dict.","commonSituations":"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.","solutions":["Remove the unknown prop from the call, or rename it to a declared parameter","Add a `**rest: rx.RestProp` parameter to the memo function if it should accept arbitrary extra props","Check the function signature for the exact set of declared props"],"exampleFix":"// before\n@rx.memo\ndef card(title: str) -> rx.Component: ...\ncard.call(title=\"x\", onClick=handler)\n\n// after\n@rx.memo\ndef card(title: str, **rest: rx.RestProp) -> rx.Component: ...\ncard.call(title=\"x\", onClick=handler)","handlingStrategy":"validation","validationCode":"import inspect\n\ndef prune_extra_props(fn, props: dict) -> dict:\n    declared = set(inspect.signature(fn).parameters)\n    return {k: v for k, v in props.items() if k in declared}\n\ncard.call(**prune_extra_props(card, incoming_props))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare `**rest: rx.RestProp` when a memo should forward arbitrary props","Avoid blindly spreading parent props into memos","Run pyright/IDE checks on memo call sites"],"tags":["reflex","memo","props","unknown-argument"],"backgroundTag":"unknown-keyword-argument","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}