Alert not working using require
Closed this issue · 4 comments
Taieb commented
I am importing Alert with require but I got this error
warning.js:45Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components)
Otherwise how to migrate from ES5 to ES2015 ?
evgenosiptsov commented
var Alert = require('react-s-alert').default;
is solving es5 require error
Taieb commented
I replaced reactify by Babelify and I used import so I solve this problem...
juliancwirko commented
Hi, I try to test it more with ES5, and fix the docs, but yeah, I encourage you to use ES2015 with Webpack or Babelify
juliancwirko commented
I don't want to change the lib for now. So I've just updated the readme file. You can import it just like @americaru said, it should work.