Skip to content

Commit

Permalink
refactor: updated modal ref calls to use optional chaining (#725)(by @…
Browse files Browse the repository at this point in the history
…jcgertig)

* Use optional chaining to make sure that the ref exisist

* Make sure ref exists with optional chaining
  • Loading branch information
jcgertig authored Nov 20, 2021
1 parent d951a19 commit 9ace1c6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const BottomSheetModalProviderWrapper = ({
*/
if (sheetIndex !== -1) {
_sheetsQueue.splice(sheetIndex, 1);
ref.current.restore();
ref?.current?.restore();
}

_sheetsQueue.push({
Expand Down

0 comments on commit 9ace1c6

Please sign in to comment.