minutemailer / react-popup

React popup component
http://minutemailer.github.io/react-popup/
MIT License
208 stars 71 forks source link

Feature/webpack pr #46

Closed z-vr closed 6 years ago

z-vr commented 6 years ago

This allows to setup a dev environment with live-reload powered by webpack-dev-server.

I've added style.css as well so that people can do import 'react-popup/style.css' to get a default style.

tbleckert commented 6 years ago

Thanks! I've wanted to switch to webpack but haven't had the time so this is very much appreciated. I noticed you also moved the proptypes and defaultprops outside the class, is there a specific reason for this?

Great idea to add the example and style.css parts as well.

I'm really grateful for your help!

z-vr commented 6 years ago

@tbleckert the reason is basically to enable stripping PropTypes for production mode with this plugin https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types, but I'm not sure if it's that useful, also I don't know what happens if components rely on default props, e.g., calling a stub () => {} function

tbleckert commented 6 years ago

Oh nice! Should be fine I think, either way it will be tested properly before it goes out to npm. I'll merge it in.