Skip to content

Commit b24ac46

Browse files
fix(@react-aria/utils): handle empty navigator.userAgentData.platform (#3290)
1 parent fb750ce commit b24ac46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@react-aria/utils/src/platform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function testUserAgent(re: RegExp) {
2222

2323
function testPlatform(re: RegExp) {
2424
return typeof window !== 'undefined' && window.navigator != null
25-
? re.test((window.navigator['userAgentData'] || window.navigator).platform)
25+
? re.test(window.navigator['userAgentData']?.platform || window.navigator.platform)
2626
: false;
2727
}
2828

0 commit comments

Comments
 (0)