Skip to content

Instantly share code, notes, and snippets.

@chrisdhanaraj
Created September 21, 2022 17:02
Show Gist options
  • Save chrisdhanaraj/a7adb83c8eb534ccdf1d2ff6cc091f6d to your computer and use it in GitHub Desktop.
Save chrisdhanaraj/a7adb83c8eb534ccdf1d2ff6cc091f6d to your computer and use it in GitHub Desktop.

Revisions

  1. chrisdhanaraj created this gist Sep 21, 2022.
    28 changes: 28 additions & 0 deletions example.tsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    const TableWrapper = ({
    someProperty,
    otherProperty
    }) => {
    const [data, loading] = useQuery({
    variables: {
    someProperty,
    otherProperty
    }
    });

    if (loading) {
    return <Loader />
    }

    return <Table someProperty={someProperty} otherProperty={otherProperty} data={data} />
    }

    const Table = ({
    somePropeerty,
    otherProperty,
    data
    }) => {
    const computed = React.useMemo(() => {}, [data, someProperty]);

    // ...othertThings

    }