Closed macmeals closed 2 years ago
#14
①useTextGet.tsの中の型名を「JsonPlace」から「Todo」へ変更しました。 useTextGet.ts
type Todo = { userId: number; id: number; title: string; completed: boolean; }; const { data } = await axios.get<Todo[]>(url);
②関数の名前「jsonFetch」を「titleFetch」へ変更しました。 useTextGet.ts const titleFetch = useCallback(async () => { return { textTitle, titleFetch };
const titleFetch = useCallback(async () => {
return { textTitle, titleFetch };
TodoLists.tsx
const { textTitle, titleFetch } = useTextGet(); useEffect(() => { titleFetch(); }, []);
Issue
#14
内容
①useTextGet.tsの中の型名を「JsonPlace」から「Todo」へ変更しました。 useTextGet.ts
②関数の名前「jsonFetch」を「titleFetch」へ変更しました。 useTextGet.ts
const titleFetch = useCallback(async () => {
return { textTitle, titleFetch };
TodoLists.tsx