Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

check if "document" is present (server-side rendering) #111

@indeyets

Description

@indeyets

componentDidUpdate() calls dispatchEvent which unconditionally calls document.createEvent('Event');

The problem is that document global is not available when server-side rendering is used (either in isomorphic scenarios or in tests).

Simple if (typeof document !== 'undefined') guard should be enough to fix this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions