chore: perfect type definition (#940)
This commit is contained in:
parent
b346bd9b83
commit
5e0540077a
25 changed files with 97 additions and 70 deletions
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue