Should be used in child components of NGLComponent
import { useComponent, NGLComponent, NGLStage } from "@i-vresse/haddock3-ui/molviewer";
function Child() {
const component = useComponent();
return <div>{component.type}</div>;
}
async function Parent() {
const structure = new File(...);
return (
<NGLStage>
<NGLComponent structure={structure} chain="A">
<ChildComponent />
</NGLComponent>
</NGLStage>
);
}
Hook that provides the current NGL structure component.