def render_dict_to_var(tag: dict | Component | str) -> Var:
    """Convert a render dict to a Var.

    Args:
        tag: The render dict.

    Returns:
        The Var.
    """
    if not isinstance(tag, dict):
        if isinstance(tag, Component):
            return render_dict_to_var(tag.render())
        return Var.create(tag)

    if "iterable" in tag:
        function_return = LiteralArrayVar.create(
            [render_dict_to_var(child.render()) for child in tag["children"]]
        )

        func = ArgsFunctionOperation.create(
            (tag["arg_var_name"], tag["index_var_name"]),
            function_return,
        )

        return FunctionStringVar.create("Array.prototype.map.call").call(
            tag["iterable"]
            if not isinstance(tag["iterable"], ObjectVar)
            else tag["iterable"].items(),
            func,
        )

    if tag["name"] == "match":
        element = tag["cond"]

        conditionals = render_dict_to_var(tag["default"])

        for case in tag["match_cases"][::-1]:
            condition = case[0].to_string() == element.to_string()
            for pattern in case[1:-1]:
                condition = condition | (pattern.to_string() == element.to_string())

            conditionals = ternary_operation(
                condition,
                render_dict_to_var(case[-1]),
                conditionals,
            )

        return conditionals

    if "cond" in tag:
        return ternary_operation(
            tag["cond"],
            render_dict_to_var(tag["true_value"]),
            render_dict_to_var(tag["false_value"])
            if tag["false_value"] is not None
            else LiteralNoneVar.create(),
        )

    props = Var("({" + ",".join(tag["props"]) + "})")

    contents = tag["contents"] if tag["contents"] else None

    raw_tag_name = tag.get("name")
    tag_name = Var(raw_tag_name or "Fragment")

    return FunctionStringVar.create(
        "jsx",
    ).call(
        tag_name,
        props,
        *([Var(contents)] if contents is not None else []),
        *[render_dict_to_var(child) for child in tag["children"]],
    )
Convert a render dict to a Var.

    Args:
        tag: The render dict.

    Returns:
        The Var.
    
reflex/components/component.py