def _register_custom_component(
    component_fn: Callable[..., Component],
):
    """Register a custom component to be compiled.

    Args:
        component_fn: The function that creates the component.

    Raises:
        TypeError: If the tag name cannot be determined.
    """
    dummy_props = {
        prop: (
            Var(
                "",
                _var_type=unwrap_var_annotation(annotation),
            ).guess_type()
            if not types.safe_issubclass(annotation, EventHandler)
            else EventSpec(handler=EventHandler(fn=no_args_event_spec))
        )
        for prop, annotation in typing.get_type_hints(component_fn).items()
        if prop != "return"
    }
    dummy_component = CustomComponent._create(
        children=[],
        component_fn=component_fn,
        **dummy_props,
    )
    if dummy_component.tag is None:
        msg = f"Could not determine the tag name for {component_fn!r}"
        raise TypeError(msg)
    CUSTOM_COMPONENTS[dummy_component.tag] = dummy_component
Register a custom component to be compiled.

    Args:
        component_fn: The function that creates the component.

    Raises:
        TypeError: If the tag name cannot be determined.
    
reflex/components/component.py