Closed blackraindrop closed 1 year ago
I am not sure I fully understand the question. Could you elaborate a little bit?
@blackraindrop Is it an issue? Can you please provide some logs and code fragments for analizing whats wrong?
because remote module
export some components
I can use imports
to set named module
with FetchRemoteComponent
export const fetchRemoteComponent: FetchRemoteComponent = ({
requires,
url,
imports = "default"
}) => {
const loadRemoteModule = createLoadRemoteModule({ requires });
return loadRemoteModule(url).then(module => {
const Component = module && module[imports];
if (!Component) {
throw new Error(`Could not load '${imports}' from '${url}'.`);
}
return Component;
});
// suppressHydrationWarning={true}
};
but useRemoteComponent
can't use imports
to set named module
const [loading, err, Component] = useRemoteComponent(url);
@blackraindrop I just merged in this update. Test it and let me know if this is what you needed. Cheers 🍻
Expected interface definitions