-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
I am trying to wrap kekule into a React widget. I am getting the following error in my console:
TypeError: Cannot read properties of undefined (reading 'ClassEx')
at kekule.react.base.js:10:22
at ...
Anyone knows what the problem may be?
Here is my initial (very basic) component:
import { ReactElement, createElement, useState, useRef } from "react";
import { Components } from "kekule-react";
const KekuleComponent = (): ReactElement => {
const [state, setState] = useState({
composerPredefinedSetting: 'molOnly',
chemObj: null
});
const composer = useRef<{ getWidget: any }>();
const onComposerUserModificationDone = () =>
{
setState(prevState => {
return { ...prevState, chemObj: composer.current?.getWidget().getChemObj() }
});
}
return (
<div>
<Components predefinedSetting={state.composerPredefinedSetting} onUserModificationDone={onComposerUserModificationDone} />
</div>
);
}
export default KekuleComponent;
Metadata
Metadata
Assignees
Labels
No labels