Replies: 3 comments
-
import algoliasearch from 'algoliasearch/lite.js'
import {
Configure,
Hits,
InstantSearch,
InstantSearchSSRProvider,
Pagination,
SearchBox,
} from 'react-instantsearch-hooks-web'
import { routing } from '~/utils/helpers/algolia-routing'
import type { InstantSearchServerState } from '../../../node_modules/react-instantsearch-hooks/dist/es/components/InstantSearchSSRProvider.js' Well getting it partially solved. Just not sure what to do about Hits and the others. And I definately want to shorten the import type for |
Beta Was this translation helpful? Give feedback.
-
So, got some help. Have a file in declare module 'react-instantsearch-hooks-typed' {
export { Configure } from '/#react-instantsearch-hooks/dist/es/index.js'
export { Hits } from '/#react-instantsearch-hooks-web/dist/es/index.js'
export { InstantSearch } from '/#react-instantsearch-hooks/dist/es/index.js'
export { InstantSearchSSRProvider } from '/#react-instantsearch-hooks/dist/es/index.js'
export { Pagination } from '/#react-instantsearch-hooks/dist/es/index.js'
export { SearchBox } from '/#react-instantsearch-hooks/dist/es/index.js'
} So, with this I'm able to export components from a module that I need. "paths": {
"~/*": ["./app/*"],
"tests/*": ["./tests/*"],
"#*": ["./node_modules/*"]
}, This is the best I have for now. Open to any recommendations for improving. Thanks! |
Beta Was this translation helpful? Give feedback.
-
:'( This expression is not callable.
Type 'typeof import("/Users/vonkoff/GoodUnionJobs/remix/node_modules/algoliasearch/lite")' has no call signatures.ts(2349) Getting the error above when trying to use searchClient below: import algoliasearch from 'algoliasearch/lite.js'
// ...
const searchClient =
process.env.NODE_ENV === 'production'
? algoliasearch('fakeletters', 'fakeletters', {
headers: {
referer: serverUrl,
},
})
: algoliasearch('fakeletters', 'fakeletters', {
}) Not sure on how to fix this... /* eslint-disable import/no-unresolved*/
export * from './dist/algoliasearch-lite';
export { default } from './dist/algoliasearch-lite'; And the default from ./dist/algoliasearch-lite' is... declare function algoliasearch(appId: string, apiKey: string, options?: AlgoliaSearchOptions): SearchClient;
declare namespace algoliasearch {
var version: string;
}
export default algoliasearch; So, I am unsure of why this is not working. |
Beta Was this translation helpful? Give feedback.
-
Hey, if anyone could offer advice with esm import would be greatly appreciated. I've found the file path to a type I need for a type called InstantSearchServerState is "node_modules/react-instantsearch-hooks/dist/es/components/InstantSearchSSRProvider.d.ts"
Writing this in a route:
import type { InstantSearchServerState } from 'react-instantsearch-hooks'
Gets an error hovering over InstantSearchServerState that says Module '"react-instantsearch-hooks"' has no exported member 'InstantSearchServerState'.ts(2305)
The things exported are when going to node_modules/react-instantsearch-hooks/dist/es/index.d.ts are:
What can I do to make this work?
Beta Was this translation helpful? Give feedback.
All reactions