diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 5e073f1..06c9613 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -1,6 +1,7 @@ // Generated by 'unplugin-auto-import' // We suggest you to commit this file into source control declare global { - + const useEffect: typeof import('react')['useEffect'] + const useState: typeof import('react')['useState'] } export {} diff --git a/vite.config.ts b/vite.config.ts index f378bd1..a0ea14e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,8 +12,20 @@ export default defineConfig({ }, }, plugins: [ - AutoImport(), react(), + AutoImport({ + include: [ + 'src/**/*.{ts,tsx}', + ], + imports: [ + { + react: [ + 'useState', + 'useEffect', + ], + }, + ], + }), UnoCSS(), ], })