Showcasing Best Practices For Building React Applications
利用 useMutation 封装自定义 hook
export const useSignUp = <T extends string>() => {
return useMutation<SuccessResponse, ErrorResponse<T>, Record<T, string>>(...)
}hook useEcharts usage
import { useECharts } from '@/hooks/useECharts'
function Example() {
const [echartRef] = useECharts({
//options...
})
return <div ref={echartRef} className="h-96 w-96" /> // <div ref={echartRef} style={{ width: 400, height: 400 }} />
}- fix:
pnpm e2eande2e:headless - vitest intersection observer polyfill