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

Implement toJSON for actions which include unserializable objects #94

Open
hoschi opened this issue Jul 11, 2017 · 1 comment
Open

Implement toJSON for actions which include unserializable objects #94

hoschi opened this issue Jul 11, 2017 · 1 comment

Comments

@hoschi
Copy link
Contributor

hoschi commented Jul 11, 2017

In short:
Redux devtools serialize actions and state. Action @@ui/CREATE_COMPONENT_STATE has the prop payload.props which can contain react nodes, which can't be handled by this serialization in some cases. To fix this implement toJSON and stub it out, see:

My use case which showed that bug:
I added react-sticky-state to my app which is a child of a component in the node tree of one child in this payload.props.children property:
2017-07-11-154921_1026x1384_scrot

One of the nodes/props react-sticky-state has something it it that is not serializable. I temporary fixed it by excluding this action in redux devtools:

    if (process.env.NODE_ENV === 'development' && window.__REDUX_DEVTOOLS_EXTENSION__) {
        storeEnhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({
            serialize: {
                // save complex data types which are not serializable by default
                options: true,
            },
            actionsBlacklist: ['@@ui/CREATE_COMPONENT_STATE']
        }));
    }
@hoschi
Copy link
Contributor Author

hoschi commented Jul 13, 2017

My workaround works not for the first time one opens the Chrome devtools and switches to redux panel, when app is already loaded.

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

No branches or pull requests

1 participant