Hi,
is that possible to add a new line mark in the notistack messege text?
I tried '\n' and '
' in many variants but its always printed as writed. 馃槩
Hi @kubalobo, I'm not sure if it's possible. maybe material-ui issues is a better place to ask this. However, you can pass whatever you want as the body of snackbar in options paramters of enqueueSnackbar.
this.props.enqueueSnackbar('I love snacks', {
children: (
<div> my entirely customised snack </div>
),
});
Thanks, but unfortunenetly it looks like children parameter doesn't change anything. Are you that it's a proper syntax?
@kubalobo which version of notistack are you using? The children option was fixed in v0.3.9, see issue #22
Yea, I had 0.3.7. It's working fine after update.
Thanks!
For these googling the solution:
enqueueSnackbar(msg, {
variant: 'error',
style: { whiteSpace: 'pre-line' }
})
Most helpful comment
For these googling the solution: