Hi guys,
I saw similar topic on this forum but it was reffering to map component/module. Now i have problem with library @tomtom-international/web-sdk-plugin-searchbox. I’m getting:
# Unhandled Runtime Error
TypeError: SearchBox is not a constructor
My code in UseEffect with (like others) dynamic import of this component.
useEffect(() => {
const Import = async() => {
const tt = await import('@tomtom-international/web-sdk-maps');
const { services } = await import('@tomtom-international/web-sdk-services')
const SearchBox = await import('@tomtom-international/web-sdk-plugin-searchbox')
var options = {
searchOptions: {
key: "<your-tomtom-API-key>",
language: "en-GB",
limit: 5,
},
autocompleteOptions: {
key: "<your-tomtom-API-key>",
language: "en-GB",
},
}
tt.setProductInfo('${productInfo.name}', '${productInfo.version}');
let ttSearchBox = new SearchBox(services, options);
});
}
Import();
},[])
Thank you for helping me !