Skip to content

Commit

Permalink
Optional chaining on matchMedia check
Browse files Browse the repository at this point in the history
  • Loading branch information
adhamu committed Sep 26, 2023
1 parent b0f34ca commit 0921e5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { globalStyles } from './theme'
import type { ReactNode } from 'react'

const matchMediaFallback = (): boolean =>
window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
window.matchMedia?.('(prefers-color-scheme: dark)')?.matches

const Wrapper = ({ children }: { children: ReactNode }) => {
const {
Expand Down

0 comments on commit 0921e5f

Please sign in to comment.