{"record":{"id":"d45a56d3ee1b54ad","repo":"reflex-dev/reflex","slug":"definition-python-name-does-not-accept-prop-d45a56","errorCode":null,"errorMessage":"`{definition.python_name}` does not accept prop `{unknown[0]}`. 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":1762,"sourceCode":"            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. ``key`` is the\n        # one exception (see ``_FORWARDABLE_BASE_PROPS``); every other undeclared\n        # prop raises with a message that points at ``rx.RestProp``.\n        if remaining_props and rest_param is None:\n            unknown = [\n                name for name in remaining_props if name not in _FORWARDABLE_BASE_PROPS\n            ]\n            if unknown:\n                msg = (\n                    f\"`{definition.python_name}` does not accept prop `{unknown[0]}`. \"\n                    \"Only declared props may be passed when no `rx.RestProp` is present.\"\n                )\n                raise TypeError(msg)\n            warned_key = frozenset(remaining_props)\n            if warned_key not in self._warned_base_props:\n                self._warned_base_props.add(warned_key)\n                _warn_legacy_base_props(definition.python_name, list(remaining_props))\n\n        # Reading ``component`` materializes the deferred body, so ``type(...)``\n        # reflects the real wrapped class rather than the placeholder.\n        if definition._runtime_inferred_params and not definition._component.is_ready:\n            runtime_values = {\n                name: explicit_values[name]\n                for name in definition._runtime_inferred_params\n                if name in explicit_values\n            }\n            component = definition._component.get(\n                lambda: _evaluate_component_body(\n                    definition.fn,\n                    definition.params,\n                    definition._rest_target_fields,","sourceCodeStart":1744,"sourceCodeEnd":1780,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/components/memo.py#L1744-L1780","documentation":"An undeclared keyword prop was passed to a memo component that has no `rx.RestProp`. The one exception is `key` (and other `_FORWARDABLE_BASE_PROPS`), which only warns — every other unknown prop raises. The message points at `rx.RestProp` as the escape hatch.","triggerScenarios":"`card(title=\"x\", aria-label=\"y\")` where `card` only declares `title`; passing `className`, event handlers, or data attributes to a memo without a rest prop.","commonSituations":"Porting class-based components that accepted arbitrary HTML props; forwarding parent props; stale prop names after renames.","solutions":["Remove the unknown prop or map it to a declared one","Declare `**rest: rx.RestProp` in the memo signature to accept and forward extra props","For `key`, note it is allowed and only triggers a legacy-props warning once"],"exampleFix":"// before\n@rx.memo\ndef card(title: str) -> rx.Component: ...\ncard(title=\"x\", data_testid=\"t\")\n\n// after\n@rx.memo\ndef card(title: str, **rest: rx.RestProp) -> rx.Component: ...\ncard(title=\"x\", data_testid=\"t\")","handlingStrategy":"validation","validationCode":"import inspect\n\ndef declared_props(fn) -> set[str]:\n    return set(inspect.signature(fn).parameters)\n\nprops = {k: v for k, v in incoming.items() if k in declared_props(card)}\ncard(**props)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare `**rest: rx.RestProp` on forwarding memos","Treat `key` as the only safe undeclared prop","Unit-test dynamic prop builders against each memo's signature"],"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"}