Home / Function/ RefreshButton() — supabase Function Reference

RefreshButton() — supabase Function Reference

Architecture documentation for the RefreshButton() function in RefreshButton.tsx from the supabase codebase.

Entity Profile

Relationship Graph

Source Code

apps/studio/components/grid/components/header/RefreshButton.tsx lines 14–40

export const RefreshButton = ({ tableId, isRefetching }: RefreshButtonProps) => {
  const { ref } = useParams()
  const queryClient = useQueryClient()
  const { invalidate: invalidateIndexAdvisor } = useTableIndexAdvisor()
  const queryKey = tableRowKeys.tableRowsAndCount(ref, tableId)

  async function onClick() {
    await queryClient.invalidateQueries({ queryKey })
    await invalidateIndexAdvisor()
  }

  return (
    <ButtonTooltip
      type="outline"
      loading={isRefetching}
      icon={<RefreshCw />}
      onClick={() => onClick()}
      className="w-7 h-7 p-0"
      tooltip={{
        content: {
          side: 'bottom',
          text: 'Refresh table data',
        },
      }}
    />
  )
}

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free