{"record":{"id":"f685ea5cfb3072e4","repo":"reflex-dev/reflex","slug":"rx-memo-only-supports-one-rx-restprop-in-fn","errorCode":null,"errorMessage":"`@rx.memo` only supports one `rx.RestProp` in `{fn.__name__}`.","messagePattern":"`@rx\\.memo` only supports one `rx\\.RestProp` in `(.+?)`\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/reflex-base/src/reflex_base/components/memo.py","lineNumber":1323,"sourceCode":"            parameter.name == \"children\"\n            and not _children_annotation_is_valid(annotation)\n            and not _is_event_handler_annotation(annotation)[0]\n        ):\n            msg = (\n                f\"`children` in `{fn.__name__}` must be annotated as \"\n                \"`rx.Var[rx.Component]`.\"\n            )\n            raise TypeError(msg)\n\n        kind, kind_data = _classify_parameter(annotation, parameter.name, fn.__name__)\n        spec = _SPECS[kind]\n        spec.validate(parameter, fn.__name__, for_component)\n\n        if kind is MemoParamKind.REST:\n            rest_count += 1\n            if rest_count > 1:\n                msg = f\"`@rx.memo` only supports one `rx.RestProp` in `{fn.__name__}`.\"\n                raise TypeError(msg)\n\n        js_prop_name = format.to_camel_case(parameter.name)\n        placeholder_name = spec.placeholder_name(\n            parameter.name, js_prop_name, for_component\n        )\n\n        params.append(\n            MemoParam(\n                name=parameter.name,\n                kind=kind,\n                kind_data=kind_data,\n                annotation=annotation,\n                parameter_kind=parameter.kind,\n                default=parameter.default,\n                js_prop_name=js_prop_name,\n                placeholder_name=placeholder_name,\n            )\n        )","sourceCodeStart":1305,"sourceCodeEnd":1341,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/components/memo.py#L1305-L1341","documentation":"An `@rx.memo` function declared more than one `rx.RestProp` parameter. The rest-props placeholder captures all remaining props as a single catch-all, so a second one is ambiguous and impossible to compile. Reflex raises this TypeError at decoration time in `_analyze_params` when `rest_count` exceeds 1.","triggerScenarios":"Declaring two parameters annotated `rx.RestProp` (or `...`), e.g. `def my_memo(a: rx.RestProp, b: rx.RestProp) -> rx.Component`, so `rest_count` increments past 1.","commonSituations":"Copy-pasting a rest-props parameter and forgetting to delete the original; assuming multiple rest props partition props by name; auto-generating signatures that emit a rest placeholder per section.","solutions":["Keep exactly one `rx.RestProp` parameter and delete the duplicates","If you need distinct groups of props, give each parameter an explicit `rx.Var[...]` annotation instead of extra rest placeholders"],"exampleFix":"# before\n@rx.memo\ndef panel(children: rx.Var[rx.Component], left: rx.RestProp, right: rx.RestProp) -> rx.Component:\n    ...\n\n# after\n@rx.memo\ndef panel(children: rx.Var[rx.Component], rest: rx.RestProp) -> rx.Component:\n    ...","handlingStrategy":"validation","validationCode":"import inspect, reflex as rx\n\ndef check_single_rest_prop(fn) -> None:\n    rests = [p for p in inspect.signature(fn).parameters.values() if p.annotation is rx.RestProp]\n    if len(rests) > 1:\n        raise TypeError(\"only one rx.RestProp parameter is allowed per @rx.memo\")","typeGuard":"import inspect, reflex as rx\n\ndef has_single_rest_prop(fn) -> bool:\n    return sum(\n        1 for p in inspect.signature(fn).parameters.values() if p.annotation is rx.RestProp\n    ) <= 1","tryCatchPattern":null,"preventionTips":["Use exactly one rest-props placeholder (conventionally named `rest`)","Give specific props explicit rx.Var[...] annotations instead of adding extra rest slots"],"tags":["reflex","rx-memo","typeerror","rest-props","parameters"],"backgroundTag":"decorator-validation-failed","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}