Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS Example for Custom Notistack #584

Open
deepakup94 opened this issue Sep 29, 2023 · 1 comment
Open

JS Example for Custom Notistack #584

deepakup94 opened this issue Sep 29, 2023 · 1 comment

Comments

@deepakup94
Copy link

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
Copy link

nxp769 commented Oct 20, 2023

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

Try this approach. This will resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants