tRPCttRPC
Powered by
JonathanJ
tRPC•12mo ago•
7 replies
Jonathan

Where did useUtils go?

I am working through upgrading my project and I use
useUtils
useUtils
here and there to do fetches from components like ag-grid which requires a data source

It looks something like this

    const utils = useUtils();
    const dataSource = useMemo(() => {
        return {
            getRows: async (params: any) => {

                utils.contacts.grid.fetch().then((response) => {
                    params.success({
                        rowData: response.rows,
                        rowCount: response.totalCount,
                    });
                });
                
            }
        }
    }, []);
    const utils = useUtils();
    const dataSource = useMemo(() => {
        return {
            getRows: async (params: any) => {

                utils.contacts.grid.fetch().then((response) => {
                    params.success({
                        rowData: response.rows,
                        rowCount: response.totalCount,
                    });
                });
                
            }
        }
    }, []);


I thought it had moved to something under getting the trpc using the
useTRPC
useTRPC
but it doesn't seem to be there, how should I get this to work?
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

useUtils vs useQueryClient
RealityShiftRRealityShift / ❓-help
3y ago
Can you ensureData without the useUtils hook?
ChenCChen / ❓-help
3y ago
Canary useUtils and createTRPCQueryUtils type not callable
SebasPtschSSebasPtsch / ❓-help
3y ago
can I use useUtils hook in trpc 11 ?
codecret | Software EngineerCcodecret | Software Engineer / ❓-help
8mo ago