New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[next] Refine typescript support #985
Comments
Sorry for bothering you guys. Do you have any plans on this? |
Hi @meteorlxy, Thanks for opening this issue.
|
Nothing exported, and only declaring two non-existed module. |
@shortcuts I had problem number 3 as well, here's a reproduction: https://stackblitz.com/edit/typescript-decjve?file=index.ts I've been fiddling around with a solution, and will submit a PR shortly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
allowSyntheticDefaultImports
docsearch/tsconfig.json
Line 3 in f30ca38
This options is poisonous. When users install
@docsearch/react
in their own project, they have to enbaleallowSyntheticDefaultImports
or enableskipLib
to make things work. Thus, for library project, it's better not to enbale this kind of compilerOptions.@types/react
in dependencies of@docsearch/react
.As the error shows, when using
@docsearch/react
with typescript, the types definition of react is also required.The generated
@docsearch/react/dist/esm/DocSearch.d.ts
(and many other files) hasimport React from 'react';
in it.node_modules/@docsearch/js/dist/esm/index.d.ts
is not a moduleWhen trying to import
@docsearch/js
in ts:Hope we can optimize typescript support~
The text was updated successfully, but these errors were encountered: