chore: perfect type definition (#940)

This commit is contained in:
bowen
2023-08-22 10:58:06 +08:00
committed by GitHub
parent b346bd9b83
commit 5e0540077a
25 changed files with 97 additions and 70 deletions

View File

@@ -1,5 +1,6 @@
'use client'
import { useEffect, useState } from 'react'
import type { Dispatch } from 'react'
import useSWR from 'swr'
import { useContext } from 'use-context-selector'
import { BookOpenIcon } from '@heroicons/react/24/outline'
@@ -24,7 +25,7 @@ const labelClass = `
const inputClass = `
w-[480px] px-3 bg-gray-100 text-sm text-gray-800 rounded-lg outline-none appearance-none
`
const useInitialValue = (depend: any, dispatch: any) => {
const useInitialValue: <T>(depend: T, dispatch: Dispatch<T>) => void = (depend, dispatch) => {
useEffect(() => {
dispatch(depend)
}, [depend])