Skip to content

Commit 5b16ce9

Browse files
Use optional chaining to prevent ref error. (#997)
1 parent a55c69c commit 5b16ce9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/simulator/AccelerometerModule.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const Gesture = ({ icon, state, enabled, onValueChange }: GestureProps) => {
100100
setTimeout(() => {
101101
setActive(false);
102102
onValueChange("gesture", "none");
103-
buttonRef.current!.focus();
103+
buttonRef.current?.focus();
104104
}, 500);
105105
}, [setActive, onValueChange, choice]);
106106

0 commit comments

Comments
 (0)