From 0617bbc136c2a4b8844fbdde50634bdff75c4522 Mon Sep 17 00:00:00 2001 From: egenerse Date: Wed, 18 Dec 2024 11:46:04 +0300 Subject: [PATCH] feat: add button to call library method --- standalone/webapp/src/LibraryView.tsx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/standalone/webapp/src/LibraryView.tsx b/standalone/webapp/src/LibraryView.tsx index 5e955c2..d295d55 100644 --- a/standalone/webapp/src/LibraryView.tsx +++ b/standalone/webapp/src/LibraryView.tsx @@ -6,14 +6,15 @@ export function LibraryView() { const containerRef = useRef(null) const apollon2Ref = useRef(null) + const onGetNodesButtonClick = () => { + // To show that the getNodes method works + if (apollon2Ref.current) { + console.log(apollon2Ref.current.getNodes()) + } + } useLayoutEffect(() => { if (containerRef.current) { apollon2Ref.current = new Apollon2(containerRef.current) - - console.log( - "Random number from Apollon2:", - apollon2Ref.current.getNodes() - ) } return () => { @@ -25,5 +26,15 @@ export function LibraryView() { } }, []) - return
+ return ( + <> + +
+ + ) }