Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.0-Beta 3: Custom notification upgrade guide code doesn't work. #3894

Closed
WiXSL opened this issue Oct 28, 2019 · 4 comments
Closed

3.0.0-Beta 3: Custom notification upgrade guide code doesn't work. #3894

WiXSL opened this issue Oct 28, 2019 · 4 comments

Comments

@WiXSL
Copy link
Contributor

WiXSL commented Oct 28, 2019

The code proposed here UPGRADE.md for using custom notifications doesn't seem to be working.

I've added a custom notification for the demo app with the upgrade guide code here:
https://codesandbox.io/s/react-admin-demo-300-gofzw

@WiXSL WiXSL closed this as completed Oct 28, 2019
@WiXSL WiXSL reopened this Oct 28, 2019
@WiXSL
Copy link
Contributor Author

WiXSL commented Oct 29, 2019

Now i've added styles to avoid the errors, but the notification won't show either way.

@fzaninotto
Copy link
Member

I think the UPGRADE snippet misses the end part, which shows that you must connect the component to the Redux store:

import { connect } from 'react-redux';
import {
    complete,
    undo,
    getNotification,
    hideNotification,
    Button,
    undoableEventEmitter
} from 'react-admin';
import compose from 'recompose/compose';

...

const mapStateToProps = state => ({
    notification: getNotification(state),
});

export default compose(
    withStyles(styles),
    connect(
        mapStateToProps,
        {
            complete,
            hideNotification,
            undo,
        }
    )
)(Notification);

Can you confirm that it solves the problem?

@WiXSL
Copy link
Contributor Author

WiXSL commented Oct 29, 2019

Ok, now is working. I've updated the PR.

@fzaninotto
Copy link
Member

Fixed by #3893

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants