def get_and_validate_app(
    reload: bool = False, check_if_schema_up_to_date: bool = False
) -> AppInfo:
    """Get the app instance based on the default config and validate it.

    Args:
        reload: Re-import the app module from disk
        check_if_schema_up_to_date: If True, check if the schema is up to date.

    Returns:
        The app instance and the app module.

    Raises:
        RuntimeError: If the app instance is not an instance of rx.App.
    """
    from reflex.app import App

    app_module = get_app(reload=reload)
    app = getattr(app_module, constants.CompileVars.APP)
    if not isinstance(app, App):
        msg = "The app instance in the specified app_module_import in rxconfig must be an instance of rx.App."
        raise RuntimeError(msg)

    if check_if_schema_up_to_date:
        check_schema_up_to_date()

    return AppInfo(app=app, module=app_module)
Get the app instance based on the default config and validate it.

    Args:
        reload: Re-import the app module from disk
        check_if_schema_up_to_date: If True, check if the schema is up to date.

    Returns:
        The app instance and the app module.

    Raises:
        RuntimeError: If the app instance is not an instance of rx.App.
    
reflex/utils/prerequisites.py