setusoft / silhouette-play-react-seed

A Silhouette Seed template which shows how Silhouette can be used to create a SPA with React/Redux and Play
MIT License
68 stars 21 forks source link

React-redux-form intialState doesn't load #36

Closed ghost closed 6 years ago

ghost commented 6 years ago

I been using silhouette all the time but new to React and have been trying out with this seed and its smooth, great. I have created another module /route/Front following the Auth structure and everything is working out except that react-redux-form.Control only doesn't load initial values in the initialFormState in any component of Front. I have tried initial form values in SignInModule for SignInComponent from Auth and it works as expected. Also Control renders in Front as an uncontrolled component but not in Auth and works as expected as like in any component in Auth. Is there anything that i can't figure out?

akkie commented 6 years ago

Could you please share a link to a repository? It's hard to find a solution without seeing some code.

ghost commented 6 years ago

Wow, Akkie thanks. Im replicating the issue. A moment.

ghost commented 6 years ago

This is the Component. The firstName text input is a basic Control.text but renders as an uncontrolled component. It has an initial value but doesn't load the value. Same as the other decorated components. I checked the FormProps value field and it contains the initial value. I have been trying to follow strict the Auth module structure.

ghost commented 6 years ago

screenshot from 2017-12-08 12-13-36

akkie commented 6 years ago

@orar

Your model path is wrong. You define it as data but you use model. So in your case you must either change the path front.material.data to front.material.model or you rename your reducer property from model to data.

ghost commented 6 years ago

Yeah right. Incredible that i never noticed something simple but did for complex stuff. This shouldn't have been an issue.