nogiszd / react-ts-gamepads

Library that enables users to consume Gamepad API inside React 🎮➡️⚛️
MIT License
9 stars 2 forks source link

fix 'window undefined' error thrown when using Next.js SSR #2

Closed RobertDaleSmith closed 1 month ago

RobertDaleSmith commented 1 month ago

Corrects issue I ran into issue #1.

Adds additional logic to haveGamepadEvents boolean to avoid window undefined errors when using this library in server-side rendered components.

image