I’ve edited your post for readability. I do not know what you are trying to do; there was very little I could do to clean up the function. Please review it, and edit to add exactly what you have.
When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.
Lastly, the only thing I can think that is the issue is the fact that the mapStateProps function is probably only being called with an object of one parameter (being state), but you have it defined as accepting an object with two parameters.