问题
It is the form that has problem https://github.com/lukeclarkson/portal/blob/master/components/client/AddClientForm.js And it is the form container https://github.com/lukeclarkson/portal/blob/master/containers/client/AddClientContainer.js.
I added a new field to the form "Active" It has database field "status" I created component for it https://github.com/lukeclarkson/portal/blob/master/components/common/form/renderRadioGroup.js
I am facing problem to pass redux value to it.
My text component is automatically taking value from the redux. https://github.com/lukeclarkson/portal/blob/master/components/common/form/renderText.js
Can anyone please help me?
回答1:
if you want to extract data from redux you can map the redux state to props. read the official documentation https://react-redux.js.org/using-react-redux/connect-mapstate#connect-extracting-data-with-mapstatetoprops and then you can access redux data in you component with props and pass in your radio group as this.props.nameOfYourProp
来源:https://stackoverflow.com/questions/59005564/passing-redux-value-to-material-ui-radio-group