{"record":{"id":"ffe6dcf31b45d0ac","repo":"reflex-dev/reflex","slug":"invalid-prop-s-invalid-fields-str-for-componen","errorCode":null,"errorMessage":"Invalid prop(s) {invalid_fields_str} for {component_name!r}. Supported props are {supported_props_str}","messagePattern":"Invalid prop\\(s\\) (.+?) for (.+?)\\. Supported props are (.+?)","errorType":"validation","errorClass":"InvalidPropValueError","httpStatus":null,"severity":"error","filePath":"packages/reflex-base/src/reflex_base/components/props.py","lineNumber":439,"sourceCode":"        Args:\n            component_name: The custom name of the component.\n            kwargs: Kwargs to initialize the props.\n\n        Raises:\n            InvalidPropValueError: If invalid props are passed on instantiation.\n        \"\"\"\n        component_name = component_name or type(self).__name__\n\n        # Validate fields BEFORE setting them\n        known_fields = set(self.__class__.get_fields().keys())\n        provided_fields = set(kwargs.keys())\n        invalid_fields = provided_fields - known_fields\n\n        if invalid_fields:\n            invalid_fields_str = \", \".join(invalid_fields)\n            supported_props_str = \", \".join(f'\"{field}\"' for field in known_fields)\n            msg = f\"Invalid prop(s) {invalid_fields_str} for {component_name!r}. Supported props are {supported_props_str}\"\n            raise InvalidPropValueError(msg)\n\n        # Use parent class initialization after validation\n        super().__init__(**kwargs)\n","sourceCodeStart":421,"sourceCodeEnd":443,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/components/props.py#L421-L443","documentation":"A Props-based component was instantiated with keyword fields that are not declared on the class. Reflex validates the provided kwargs against the known field names and raises `InvalidPropValueError` listing the invalid and supported props.","triggerScenarios":"`rx.SomePropsComponent(invalid_prop=1)` where `invalid_prop` is not a declared props field; often from typos or passing props belonging to a different component.","commonSituations":"Version upgrades where a prop was renamed/removed, IDE autocompleting props from another component, or forwarding a shared props dict to multiple components.","solutions":["Fix the typo / remove the invalid prop","Check the error's supported-props list and use the correct name","If forwarding props, intersect the dict with each component's fields before passing"],"exampleFix":"# before\nrx.el.input(placeholder=\"x\", valuee=\"y\")\n\n# after\nrx.el.input(placeholder=\"x\", value=\"y\")","handlingStrategy":"validation","validationCode":"from dataclasses import fields\n\ndef valid_kwargs(cls, kwargs: dict) -> dict:\n    known = {f.name for f in fields(cls)}\n    bad = set(kwargs) - known\n    if bad:\n        raise KeyError(f\"unknown props {bad}; known: {sorted(known)}\")\n    return kwargs\n\nrx.el.input(**valid_kwargs(rx.el.Input, props))","typeGuard":"def has_prop(component_cls, name: str) -> bool:\n    from dataclasses import fields\n    return name in {f.name for f in fields(component_cls)}","tryCatchPattern":"from reflex.components.props import InvalidPropValueError\n\ntry:\n    comp = rx.el.input(**props)\nexcept InvalidPropValueError as e:\n    known = {f.name for f in __import__(\"dataclasses\").fields(rx.el.Input)}\n    comp = rx.el.input(**{k: v for k, v in props.items() if k in known})","preventionTips":["Let the IDE's typed stubs autocomplete props instead of hand-writing dicts","Filter shared prop dicts per component before passing"],"tags":["reflex","props","validation","unknown-argument"],"backgroundTag":"unknown-keyword-argument","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}