I'm trying to use ALERTIFYJS in react but its alertify alerts are not working. Below is the code
(window.alert is working fine on my browser)
import alertify from 'alertifyjs';
clickHandle = () => {
alertify.alert('Alert Title', 'Alert Message!', function(){
alertify.success('Ok');
});
}
Need to add the css file too. Problem Solved.
import 'alertifyjs/build/css/alertify.css';
Yes, You have to add css file as well.
Here is the process for adding css and importing alertify
import alertify from 'alertifyjs';
import 'alertifyjs/build/css/alertify.css';
or
import * as alertify from 'alertifyjs';
import 'alertifyjs/build/css/alertify.css';
Please note I have tested this code on react js 16.13.1 with restify 1.13.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With