universal-react-redux-starter-kit icon indicating copy to clipboard operation
universal-react-redux-starter-kit copied to clipboard

Redux devTools showing state as empty

Open kuatro opened this issue 8 years ago • 5 comments

As I guess, after server-side rendering the client must fill a state from window.___INITIAL_STATE__. But for some reason Redux devTools shows async piece of state as empty. As I understood that means the text on page is only rendered HTML, and state is actually empty?

2017-01-09 18 49 15

kuatro avatar Jan 09 '17 12:01 kuatro

Yean. When you load the specify page. The redux tree will show correct.

bodyno avatar Jan 09 '17 14:01 bodyno

@bodyno sorry?

kuatro avatar Jan 09 '17 15:01 kuatro

Aha?

bodyno avatar Jan 09 '17 16:01 bodyno

Below you can see, that server sends only initial state:

 <script data-react-helmet="true" type="text/javascript">
        ___INITIAL_STATE__ = {
            "router": {
                "locationBeforeTransitions": {
                    "pathname": "/async",
                    "search": "",
                    "hash": "",
                    "state": null,
                    "action": "POP",
                    "key": "5w0791",
                    "query": {},
                    "$searchBase": {
                        "search": "",
                        "searchBase": ""
                    }
                }
            },
            "counter": 0,
            "async": {}
        }
    </script>

kuatro avatar Jan 11 '17 08:01 kuatro

@bodyno, @kuatro That is correct, i solved this issue in a server package of myself, a example repo on how to use that package is here

This project comes with react-esc, a package i created and actively use myself.

react-esc is a server and client package, so you don't need to create a client or server for your project.

TriPSs avatar Feb 15 '17 16:02 TriPSs