score:5

Accepted answer
import { withAlert } from 'react-alert'

class App extends React.Component {
  render() {
    const alert = this.props.alert;
    return (
      <button
        onClick={() => {
         alert.show('Oh look, an alert!')
        }}
       >
        Show Alert
      </button>
    );
  }
}

export default withAlert()(App)

score:1

import {alert} from 'react-alert';

alert.show('Some message', {
  ... options
})

Related Query

More Query from same tag