iamhosseindhv / notistack

Highly customizable notification snackbars (toasts) that can be stacked on top of each other
https://notistack.com
Other
3.93k stars 298 forks source link

JS Example for Custom Notistack #584

Open deepakup94 opened 1 year ago

deepakup94 commented 1 year ago

I am trying to implement custom component in JS but getting error component is not ref forwarding. I checked your from https://notistack.com/features/customization#custom-component but the example is in TSX. Can you please make a JS example? Thanks

nxp769 commented 1 year ago

`<SnackbarProvider Components={{ success: React.forwardRef((props, ref) => { return ( <Alert ref={ref} onClose={() => {}} key={props.id} severity="success"

{props.message} ); }), }} maxSnack={3} `

Try this approach. This will resolve the issue.