DouglasConnect / jsme-react

11 stars 13 forks source link

this.jsmeApplet === undefined error #6

Open svaraborut opened 3 years ago

svaraborut commented 3 years ago

When the component is loaded with a smile variable that is asynchronously set:

<Jsme height='800px' width='100%' smiles={smile_draft} ></Jsme>

A race condition between componentDidUpdate and handleJsmeLoad occurs:

image

Usually Jsme is loaded after update. The if check does not work as this.jsmeApplet === undefined and not this.jsmeApplet === null

Fixed in my pull request.

danyx23 commented 3 years ago

Thanks for reporting this and sending the PR. I've just merged it and will publish a new version soon

9527xsg commented 2 years ago
if (this.props.smiles !== prevProps.smiles) {
9384 this.jsmeApplet.readGenericMolecularInput(this.props.smiles);

This error occurs when refreshing the page

9527xsg commented 2 years ago

截屏2022-07-12 18 03 03的副本