{"record":{"id":"1509e0423746ad3b","repo":"reflex-dev/reflex","slug":"provide-a-single-child-for-debounceinput-such-as","errorCode":null,"errorMessage":"Provide a single child for DebounceInput, such as rx.input() or rx.text_area()","messagePattern":"Provide a single child for DebounceInput, such as rx\\.input\\(\\) or rx\\.text_area\\(\\)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"packages/reflex-components-core/src/reflex_components_core/core/debounce.py","lineNumber":84,"sourceCode":"        the child, and then neuter the child's render method so it produces no output.\n\n        Args:\n            *children: The child component to wrap.\n            **props: The component props.\n\n        Returns:\n            The DebounceInput component.\n\n        Raises:\n            RuntimeError: unless exactly one child element is provided.\n            ValueError: if the child element does not have an on_change handler.\n        \"\"\"\n        if len(children) != 1:\n            msg = (\n                \"Provide a single child for DebounceInput, such as rx.input() or \"\n                \"rx.text_area()\"\n            )\n            raise RuntimeError(msg)\n\n        child = children[0]\n        if \"on_change\" not in child.event_triggers:\n            msg = \"DebounceInput child requires an on_change handler\"\n            raise ValueError(msg)\n\n        # Carry known props and event_triggers from the child.\n        props_from_child = {\n            p: getattr(child, p)\n            for p in cls.get_props()\n            if getattr(child, p, None) is not None\n        }\n        props[EventTriggers.ON_CHANGE] = child.event_triggers.pop(\n            EventTriggers.ON_CHANGE\n        )\n        props = {**props_from_child, **props}\n\n        # Carry all other child props directly via custom_attrs","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-components-core/src/reflex_components_core/core/debounce.py#L66-L102","documentation":"`rx.debounce_input()` wraps exactly one input child (rx.input, rx.text_area, etc.) to debounce its on_change events. Passing zero children, multiple children, or a fragment triggers this RuntimeError at creation time.","triggerScenarios":"`rx.debounce_input()` with no child; `rx.debounce_input(rx.input(...), rx.icon(...))`; passing children as a list.","commonSituations":"Adding decorative siblings (icons, labels) inside debounce_input instead of around it; forgetting the child during refactoring.","solutions":["Wrap exactly one input component: rx.debounce_input(rx.input(value=State.val, on_change=State.set_val))","Place extra elements as siblings: rx.hstack(rx.debounce_input(rx.input(...)), rx.icon('search'))","For multiple inputs, use one debounce_input per input"],"exampleFix":"// before\nrx.debounce_input(rx.input(...), rx.text('chars'))\n// after\nrx.hstack(rx.debounce_input(rx.input(...)), rx.text('chars'))","handlingStrategy":"validation","validationCode":"assert len(children) == 1, 'debounce_input takes exactly one input child'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap a single input; put icons/labels outside debounce_input","One debounce_input per input element"],"tags":["reflex","debounce","component-children"],"backgroundTag":"invalid-children-count","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}