Skip to content

Commit

Permalink
check 0 more explicitly
Browse files Browse the repository at this point in the history
based off feedback, would prefer to check if 0 directly, than implicit !== 'undefined'
  • Loading branch information
JimmyMultani authored Oct 24, 2019
1 parent 2a75041 commit 4388455
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SnackbarProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class SnackbarProvider extends Component {
}
}

const id = typeof key !== 'undefined' ? key : new Date().getTime() + Math.random();
const id = key || key === 0 ? key : new Date().getTime() + Math.random();
const snack = {
key: id,
...options,
Expand Down

0 comments on commit 4388455

Please sign in to comment.