def _validate_return_types(cls, match_cases: list[list[Var]]) -> None:
        """Validate that match cases have the same return types.

        Args:
            match_cases: The match cases.

        Raises:
            MatchTypeError: If the return types of cases are different.
        """
        first_case_return = match_cases[0][-1]
        return_type = type(first_case_return)

        if isinstance(first_case_return, BaseComponent):
            return_type = BaseComponent
        elif isinstance(first_case_return, Var):
            return_type = Var

        for index, case in enumerate(match_cases):
            if not isinstance(case[-1], return_type):
                msg = (
                    f"Match cases should have the same return types. Case {index} with return "
                    f"value `{case[-1]._js_expr if isinstance(case[-1], Var) else textwrap.shorten(str(case[-1]), width=250)}`"
                    f" of type {type(case[-1])!r} is not {return_type}"
                )
                raise MatchTypeError(msg)
Validate that match cases have the same return types.

        Args:
            match_cases: The match cases.

        Raises:
            MatchTypeError: If the return types of cases are different.
        
reflex/components/core/match.py