reflex-dev/reflex · error · ValueError
f"The prop {prop!r} is deprecated, but the replacement {new_
Error message
f"The prop {prop!r} is deprecated, but the replacement {new_prop!r} is also passed. Please remove {prop!r}." What it means
react-player deprecated certain props in favor of replacements (tracked in _DEPRECATED_PROP_MAP). Passing both the old prop and its replacement is ambiguous, so Reflex raises ValueError telling you to remove the deprecated one; passing only the old one logs a warning and auto-migrates it.
Source
Thrown at packages/reflex-components-react-player/src/reflex_components_react_player/react_player.py:256
"""Create a component.
Args:
*children: The children of the component.
**props: The props of the component.
Returns:
The created component.
Raises:
ValueError: If both a deprecated prop and its replacement are both passed.
"""
for prop, new_prop in _DEPRECATED_PROP_MAP.items():
if prop in props:
if new_prop in props:
msg = (
f"The prop {prop!r} is deprecated, but the replacement {new_prop!r} is also passed. Please remove {prop!r}.",
)
raise ValueError(msg)
logger.warning(
f"The prop {prop!r} has been replaced by {new_prop!r}, please update your code.",
)
props[new_prop] = props.pop(prop)
return super().create(*children, **props) # type: ignore[return-value]
def _render(self, props: dict[str, Any] | None = None):
"""Render the component. Adds width and height set to None because
react-player will set them to some random value that overrides the
css width and height.
Args:
props: The props to pass to the component.
Returns:
The rendered component.
"""
return (View on GitHub (pinned to 45b8ed5ab7)
Solutions
- Remove the deprecated prop and keep only the new one
- Check _DEPRECATED_PROP_MAP in react_player.py to see the exact old→new mapping
- Update all call sites and silence the migration warning by using new names exclusively
Example fix
# before rx.react_player(url=media_url, src=media_url) # after rx.react_player(src=media_url)
Defensive patterns
Strategy: validation
Validate before calling
for old in _DEPRECATED_PROP_MAP:
if old in props:
props.pop(old) # keep only the new prop Prevention
- After upgrading react-player, grep call sites for old prop names
- Never pass both an old prop and its documented replacement
When it happens
Trigger: e.g. rx.react_player(url=..., src=...) when src replaced url, or any old/new pair from _DEPRECATED_PROP_MAP passed together (commonly url→src style renames across versions).
Common situations: Upgrading reflex-components-react-player and merging old example code with new docs; copy-pasting snippets that mix API generations.
Related errors
- ChildrenTypeError(component=cls.__name__, child=child)
- Do not override _add_style directly. Use add_style instead.
- The component `{comp_name}` cannot have `{child_name}` as a
- The component `{comp_name}` only allows the components: {val
- The component `{child_name}` can only be a child of the comp
AI-assisted analysis of reflex-dev/reflex@45b8ed5ab7 (2026-08-28).
Data as JSON: /api/errors/a7525ad5a7fac1ff.
Report an issue: GitHub.