I would like to ask when to write toJSON.
I wrote a demo with react-redux.
In reducer, my web console can outputHere my code inside does not have toJSON.
But I have to do TOSJSON in components inside, as shown in the figureThere would be no corresponding data on my page without toJSON at the arrow position.
You’d better tell me something about Why? There is still time to use toJSON, thank you ~
You only need to distinguish the data structure and JSON (string describing the data) in the program, and this problem is easy to understand.