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

Not Working !! #13

Open
sinhaniik opened this issue Mar 20, 2024 · 3 comments
Open

Not Working !! #13

sinhaniik opened this issue Mar 20, 2024 · 3 comments

Comments

@sinhaniik
Copy link

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 (



Hello world.


);
}

export default App`

@laladeveloper
Copy link

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

@laladeveloper
Copy link

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.
Click me to show notification

);
}
export default App`

@fabioshub
Copy link
Owner

!!

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

3 participants