Skip to content

[feature] Add support to React Native #32

@dsfkarell

Description

@dsfkarell

Make this also a React Native compatible library.

Currently, when importing using the standard method described in the documentation, the following error occurs during server rendering:
TypeError: window.matchMedia is not a function (it is undefined)

This error occurs because the Toaster component in the sileo library (or one of its dependencies such as Framer Motion) attempts to use the window.matchMedia API to detect system preferences (such as dark mode or motion reduction). See here or here.

Sileo uses browser APIs (such as window.matchMedia and SVG filters) that do not exist in the native React Native environment, so it is not compatible with the native iOS and Android engines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions