Skip to content

Instantly share code, notes, and snippets.

View nicostombros's full-sized avatar

Nicos Tombros nicostombros

View GitHub Profile
@nicostombros
nicostombros / data-table.tsx
Last active June 12, 2024 10:57
Shadcn UI implementation of DataTable and Pagination components working together
// same as your regular shadcn datatable implementation (which uses tanstack table)
// note that the shadcn datatable uses shadcn table for the ui. see https://ui.shadcn.com/docs/components/data-table
import {
ColumnFiltersState,
SortingState,
VisibilityState,
flexRender,
getCoreRowModel,
getFilteredRowModel,
import { Environment, Network, RecordSource, Store } from "relay-runtime";
const store = new Store(new RecordSource());
const network = Network.create((operation, variables) => {
return fetch("http://127.0.0.1:8000/graphqlEndpoint/", {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json"