minutemailer / react-popup

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

error messages #25

Closed SkyJedi closed 7 years ago

SkyJedi commented 7 years ago

I'm getting these errors when i load in my project

warning.js:36 Warning: PopupHeader: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.

warning.js:36 Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

tbleckert commented 7 years ago

Thanks, that's due to an update in React. You should still be able to use the package though. I will see if I can manage to work on a patch during the day. I'll let you know when it's up.

SkyJedi commented 7 years ago

I thought so. I did get the popups working with your stylesheets, now to get a form working in the popup. Thanks for this awesome module!

tbleckert commented 7 years ago

Nice! I'm glad you like it!

z-vr commented 7 years ago

@SkyJedi if you use react-form you will have to use ref property

let form;
const submitFunction = () => {
    if (form && typeof form.submitForm === 'function') {
        form.submitForm();
    }
};
const formComponent = (
    <Form
    ref={(el) => { if (el) { form = el; } }}
    onSuccess={() => {
        Popup.close();
    }}
    />
);

Popup.create({
    title: `Form`,
    content: formComponent,
    className: 'alert',
    buttons: {
        right: [
            {
                text: 'Cancel',
                className: 'danger',
                action: Popup.close,
            },
            {
                text: 'Add',
                className: 'success',
                action: submitFunction,
            },
        ],
    },
});
tbleckert commented 7 years ago

The warnings should now be gone in the latest release (0.8.0)

SkyJedi commented 7 years ago

Thanks for the fix!

I'm still getting 0.7.1 on npm install react-popup

tbleckert commented 7 years ago

On a new install? Strange. Or maybe you have it in your package.json with 0.7.1?

SkyJedi commented 7 years ago

Thanks! that was the issue. Totally me, youre awesome

tbleckert commented 7 years ago

Hehe no problem, glad it works now!