wails icon indicating copy to clipboard operation
wails copied to clipboard

How do i wrap the wails init function using the Next.js boilerplate code?

Open anarchy1337x opened this issue 3 years ago • 3 comments

I cannot access the wails window object to omit events vice-versa between golang and javascript.

Is there a way to wrap the DOM with the init function? Or is there a different way?

Thanks.

image

anarchy1337x avatar Sep 12 '22 05:09 anarchy1337x

Hey there 👋 Looks like you're using Wails v1. Please upgrade to Wails v2 👍 https://wails.io/docs/next/reference/runtime/events/

leaanthony avatar Sep 12 '22 08:09 leaanthony

I'm using Wails V2. The problem is that the janky workound i've implemented registers, but the onevent function calls multiple times.

window.runtime.EventsOn("notification", (data: any) => {});

And i cannot hook the render() function.

anarchy1337x avatar Sep 12 '22 20:09 anarchy1337x

@anarchy1337x you might wanna put it on useEffect hook to listen once at beginning only.

dzpt avatar Sep 14 '22 02:09 dzpt

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 02 '22 02:11 stale[bot]