Skip to content

Commit 4388455

Browse files
authored
check 0 more explicitly
based off feedback, would prefer to check if 0 directly, than implicit !== 'undefined'
1 parent 2a75041 commit 4388455

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SnackbarProvider.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class SnackbarProvider extends Component {
5757
}
5858
}
5959

60-
const id = typeof key !== 'undefined' ? key : new Date().getTime() + Math.random();
60+
const id = key || key === 0 ? key : new Date().getTime() + Math.random();
6161
const snack = {
6262
key: id,
6363
...options,

0 commit comments

Comments
 (0)