Obtener objeto de ventana en NextJS

componentDidMount() {
   console.log('window.innerHeight', window.innerHeight);
}

this not work in next js
Lonely Louse