UNPKG

react-use-system-theme

Version:

React Hook to get the system theme (OS theme: light or dark) based on prefers-colors-scheme. Subscribes to changes as well.

40 lines (18 loc) 1.54 kB
# Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. ### [1.1.1](https://github.com/zebateira/react-use-system-theme/compare/v1.1.0...v1.1.1) (2020-02-04) ### Bug Fixes * suppress react warning "useLayoutEffect does nothing on the server" ([299b2dd](https://github.com/zebateira/react-use-system-theme/commit/299b2dd6f9dfd46d9bc8fbeadd9b91848ea4a98d)) ## [1.1.0](https://github.com/zebateira/react-use-system-theme/compare/v1.0.4...v1.1.0) (2020-02-04) ### Features * support initialTheme value ([386fdcc](https://github.com/zebateira/react-use-system-theme/commit/386fdcce991558d0937a38670b8082910692dad6)) ### Bug Fixes * use useLayoutEffect on setup to avoid re-render on ssr apps ([6196355](https://github.com/zebateira/react-use-system-theme/commit/6196355e7216ea7e0bb0e0be8f9d91f821c9e612)) ### [1.0.4](https://github.com/zebateira/react-use-system-theme/compare/v1.0.3...v1.0.4) (2020-02-03) ### Bug Fixes * correct arguments on addListener and removeListener ([507f4a7](https://github.com/zebateira/react-use-system-theme/commit/507f4a741ee90665b5e2abc081a303c7447120a0)) ### [1.0.3](https://github.com/zebateira/react-use-system-theme/compare/v1.0.2...v1.0.3) (2020-02-03) ### Bug Fixes * change MediaQueryList listener ([c277610](https://github.com/zebateira/react-use-system-theme/commit/c27761096e9059092a2632584f7ec1ebb82ef387)) <a name="1.0.0"></a> # 1.0.0 (2019-12-02)