React-hook-form: Version 4.5.0 WebpackError: ReferenceError: window is not defined during SSR

Created on 14 Jan 2020  路  3Comments  路  Source: react-hook-form/react-hook-form

Describe the bug
Using with gatsby will cause ReferenceError: window is not defined during build time.

To Reproduce
Use useForm hook in gatsby pages.

Here is where the error happens.
https://github.com/react-hook-form/react-hook-form/blob/61d019f308770888f250d54566217ce451df81d2/src/useForm.ts#L92

bug

Most helpful comment

thanks will patch that issue. thanks

All 3 comments

thanks will patch that issue. thanks

can you try this beta? [email protected]

can you try this beta? [email protected]

it works for me, thanks!

Was this page helpful?
0 / 5 - 0 ratings