react-nextjs-toast
react-nextjs-toast copied to clipboard
Can i use ToastProvider component?
I want to use toast after registering the provider globally in the App.js
, do you have any development plans yet as like below?
const App: React.FC = (): JSX.Element => {
const options = {
align: 'left',
position: 'top',
id: 'foo-bar'
}
return (
<FooProvider>
<ToastProvider {...options} >
<Component />
</ToastProvider>
</FooProvider>
)
}
I don't have the plan but same can be achieved using the component like this.
const App: React.FC = (): JSX.Element => {
const options = {
align: 'left',
position: 'top',
id: 'foo-bar'
}
return (
<FooProvider>
{/* Your component /*}
<Component />
{/* Toast component /*}
<ToastProvider {...options} />
</FooProvider>
)
}```