mirror of
https://github.com/expo/appjs25-eas-update-workshop-code.git
synced 2026-11-14 17:48:09 -10:00
16 lines
348 B
TypeScript
16 lines
348 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
|
|
const data = require("../api/cma_artwork.json");
|
|
|
|
export const useWorkByIdQuery = function (id: string) {
|
|
// Queries
|
|
const query = useQuery({
|
|
queryKey: [`works:${id}`],
|
|
queryFn: async () => {
|
|
return data.data.find((item: any) => item.id === id);
|
|
},
|
|
});
|
|
|
|
return query;
|
|
};
|