#How would you use appWindow with a next.js frontend? window is undefined

4 messages · Page 1 of 1 (latest)

junior dagger
#

By importing import { appWindow } from "@tauri-apps/api/window"; in a next.js frontend will error that window is not defined. How would you use that? Or should I just invoke rust code instead?

willow ginkgo
#

if you could use react.js then suggest use react.js instead of next.js

#

SSR isn't use at all in tauri, unless you bundle a additional you self.

junior dagger
#

Ah yes, I actually solved it like this (but yeah, some headache):

    const appWindow = (await import("@tauri-apps/api/window")).appWindow;

    appWindow.minimize();
  
};```