react-push-notification icon indicating copy to clipboard operation
react-push-notification copied to clipboard

Not Working !!

Open sinhaniik opened this issue 11 months ago • 3 comments

I Tried this code on my windows machine with chrome as a browser but code does not works

`import addNotification from 'react-push-notification'; import './App.css'

function App() { const buttonClick = () => { addNotification({ title: 'Warning', subtitle: 'This is a subtitle', message: 'This is a very long message', theme: 'darkblue', duration: 5000, native: true // when using native, your OS will handle theming. }); };

return ( <div className="page"> <button onClick={buttonClick} className="button"> Hello world. ); }

export default App`

sinhaniik avatar Mar 20 '24 08:03 sinhaniik

You have to add a button which should have an onclick={buttonClick} function then it will work

laladeveloper avatar Apr 30 '24 11:04 laladeveloper

Update your code as follows `import addNotification from 'react-push-notification'; import './App.css'

function App() { const btnClicked = () => { addNotification({ title: 'Warning', subtitle: 'This is a subtitle', message: 'This is a very long message', theme: 'darkblue', duration: 5000, native: true // when using native, your OS will handle theming. }); };

return (

Hello world.

); } export default App`

laladeveloper avatar Apr 30 '24 11:04 laladeveloper

!!

fabioshub avatar Sep 06 '24 13:09 fabioshub