Skip to content

Commit c5da5d2

Browse files
chore: fix load from external data source demo
1 parent eb2cf49 commit c5da5d2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/demo/views/WebSourceView.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CustomWorkspaces } from '@zakodium/nmrium-core';
1+
import type { CustomWorkspaces, NmriumData } from '@zakodium/nmrium-core';
22
import init from '@zakodium/nmrium-core-plugins';
33
import { useCallback, useEffect, useState } from 'react';
44
import { ObjectInspector } from 'react-inspector';
@@ -24,7 +24,7 @@ interface WebSourceViewProps {
2424
}
2525

2626
export default function WebSourceView(props: WebSourceViewProps) {
27-
const [data, setData] = useState();
27+
const [data, setData] = useState<NmriumData>();
2828

2929
const {
3030
file,
@@ -39,8 +39,8 @@ export default function WebSourceView(props: WebSourceViewProps) {
3939
const [isCallbackVisible, showCallback] = useState(false);
4040

4141
useEffect(() => {
42-
void loadFromURL(file).then((d) => {
43-
setData(d as any);
42+
void loadFromURL(file).then(([state]) => {
43+
return setData(state.data as any);
4444
});
4545
}, [baseURL, file, props]);
4646

0 commit comments

Comments
 (0)