lawikayoub / kotlin-poc-frontend-react-redux

Implementation/translation of the react-redux Todo List example project in Kotlin
MIT License
38 stars 18 forks source link

The previous state received by the reducer has unexpected type of "Object". #3

Open egoossens opened 4 years ago

egoossens commented 4 years ago

I just cloned the repo and ran the app.

I get the following warning:

The previous state received by the reducer has unexpected type of "Object". Expected argument to be an object with the following keys: "todos", "visibilityFilter"

Any idea where this might be coming from?

Jturpijn commented 4 years ago

I just cloned the project, ran the gradlew -t run command in the root of the project and it started building. It compiled succesfully and webpack started running at localhost:8088 as documented in the README.md.

Jturpijn commented 4 years ago

Due to a lack of resources, I'm currently running into the same error. Did you manage solving your error @egoossens ?

lawikayoub commented 4 years ago

I believe this has something to do with the way Kotlin classes are transpiled to JS, though I am not entirely sure, I may have misconfigured something (rEnhancer maybe?). I'll look into this when I have time.

OleksandrSamsonov commented 3 years ago

To avoid this warning you can just make something like this.

val store = createStore<State, RAction, dynamic>( combinedReducers(), JSON.parse(JSON.stringify(State())), compose( rEnhancer(), js("if(window.__REDUX_DEVTOOLS_EXTENSION__ )window.__REDUX_DEVTOOLS_EXTENSION__ ();else(function(f){return f;});") ) ) Unfortunately cannot find anything other than this to overdue this warning