Home

Issue: 3104

Using window on server side

[issue link]

Hey,
I would like to make a file called variables.js that expose some helpers.

In those helpers I would like to use one called :

export const isMobile = typeof window !== "undefined" ? window.matchMedia("(min-width: 1000px)") : false;

I would like to know if there is a proper way to deal with that ? Am I wrong ?

BEst regards

This question is available on Nuxt.js community (#c2689)