juliancwirko / react-s-alert

Alerts / Notifications for React with rich configuration options
https://www.npmjs.com/package/react-s-alert
MIT License
649 stars 69 forks source link

Alert not working using require #17

Closed Taieb closed 8 years ago

Taieb commented 8 years ago

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 8 years ago

var Alert = require('react-s-alert').default; is solving es5 require error

Taieb commented 8 years ago

I replaced reactify by Babelify and I used import so I solve this problem...

juliancwirko commented 8 years ago

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 8 years ago

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.