From a83d9019d5dfdb6ce97a7696912c512e0c8ca360 Mon Sep 17 00:00:00 2001 From: Nick Aspinall Date: Wed, 7 Nov 2018 13:55:57 +0000 Subject: [PATCH] Fix issue with enqueueSnackbar options so that children can override the SnackbarContent component --- src/SnackbarItem/SnackbarItem.js | 42 +++++++++++++++++--------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/SnackbarItem/SnackbarItem.js b/src/SnackbarItem/SnackbarItem.js index 6a5e7ed4..fc5a0e11 100644 --- a/src/SnackbarItem/SnackbarItem.js +++ b/src/SnackbarItem/SnackbarItem.js @@ -72,26 +72,28 @@ class SnackbarItem extends Component { onClose={this.handleClose(key)} onExited={() => onExited(key)} > - - {!hideIconVariant ? : null} - {snack.message} - - )} - action={contentProps.action && ( - - {contentProps.action} - - )} - /> + {(!!snack && snack.children) || ( + + {!hideIconVariant ? : null} + {snack.message} + + )} + action={contentProps.action && ( + + {contentProps.action} + + )} + /> + )} ); }