def _get_hook_deps(hook: str) -> list[str]:
        """Extract var deps from a hook.

        Args:
            hook: The hook line to extract deps from.

        Returns:
            A list of var names created by the hook declaration.
        """
        # Ensure that the hook is a var declaration.
        var_decl = hook.partition("=")[0].strip()
        if not any(var_decl.startswith(kw) for kw in ["const ", "let ", "var "]):
            return []

        # Extract the var name from the declaration.
        _, _, var_name = var_decl.partition(" ")
        var_name = var_name.strip()

        # Break up array and object destructuring if used.
        if var_name.startswith(("[", "{")):
            return [
                v.strip().replace("...", "") for v in var_name.strip("[]{}").split(",")
            ]
        return [var_name]
Extract var deps from a hook.

        Args:
            hook: The hook line to extract deps from.

        Returns:
            A list of var names created by the hook declaration.
        
reflex/components/component.py