Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 3d3b81f

Browse files
committed
fix(SSR): Change how is tested on presence of window
1 parent cf7b75b commit 3d3b81f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/index.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ export default Vue.component<IVueTransitiona11yProps>('transition-a11y', {
1414
},
1515
},
1616
render: (h, { data, props: { reduceMotion }, children }) => {
17-
const matchMedia = window && window.matchMedia(MEDIA_QUERY_REDUCE_MOTION);
18-
return reduceMotion && matchMedia.matches
19-
? children
20-
: h('transition', data, children);
17+
if (typeof window === 'undefined') return children;
18+
const { matches = false } = window.matchMedia(MEDIA_QUERY_REDUCE_MOTION);
19+
return reduceMotion && matches ? children : h('transition', data, children);
2120
},
2221
});

0 commit comments

Comments
 (0)