[GH-ISSUE #32] [feature] Add support to React Native #19

Open
opened 2026-03-02 05:16:34 +03:00 by kerem · 0 comments
Owner

Originally created by @dsfkarell on GitHub (Feb 26, 2026).
Original GitHub issue: https://github.com/hiaaryan/sileo/issues/32

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.

Originally created by @dsfkarell on GitHub (Feb 26, 2026). Original GitHub issue: https://github.com/hiaaryan/sileo/issues/32 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]( https://github.com/hiaaryan/sileo/blob/9793f844349983e140cf33cebbb8f51626d41407/src/toast.tsx#L228) or [here](https://github.com/hiaaryan/sileo/blob/9793f844349983e140cf33cebbb8f51626d41407/src/toast.tsx#L238). 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sileo#19
No description provided.