난 내가 이렇게 REDUX 형태 호환 만든 텍스트 필드가 를 처리 할 수있는 여기에 문제가 발생 해요 :재료 UI 텍스트 필드의 i 번째 REDUX 양식의 문제
const renderTextField = props => (
<TextField {...props} />
);
내가이야을 이처럼 사용하여 :
<Field
id="searchCif"
name="searchCif"
component={renderTextField}
floatingLabelText={SEARCHVIEW_HINT_CIF}
floatingLabelFixed={false}
value
/>
난 내 컨테이너에이 글을 쓰는 :
import { reduxForm } from 'redux-form/immutable';
import { connect } from 'react-redux';
// import { injectIntl } from 'react-intl';
import SearchDefaultView from './views/searchDefaultView';
import { requestCustomerInfo } from './actions/customerActions';
export const mapDispatchToProps = dispatch => (
{
requestCustomerInfo: formData =>
dispatch(requestCustomerInfo(formData))
}
);
const SearchDefaultReduxForm = reduxForm({
form: 'customerInfo', // a unique identifier for this form
})(SearchDefaultView);
const SearchDefaultContainer = connect(
null,
mapDispatchToProps
)(SearchDefaultReduxForm);
export default SearchDefaultContainer;
하지만 값을 쓰고 양식을 제출할 때 양식에 값이 없습니다. 내가 뭘 놓치고 있니?
const renderTextField = ({
input,
label,
meta: { touched, error },
...custom
}) =>
<TextField
hintText={label}
floatingLabelText={label}
errorText={touched && error}
{...input}
{...custom}
/>
const SearchDefaultView = (props) => {
const { requestCustomerInfo, handleSubmit } = props;
return (
<form onSubmit={handleSubmit(requestCustomerInfo)}>
<Menu
autoWidth={false}
style={styleSearchMenu}
>
<Divider />
<Field
id="searchCif"
name="searchCif"
component={renderTextField}
floatingLabelText={SEARCHVIEW_HINT_CIF}
floatingLabelFixed={false}
/>
<br />
<Field
id="searchAFM"
name="searchAFM"
component={renderTextField}
floatingLabelText={SEARCHVIEW_HINT_AFM}
floatingLabelFixed={false}
/>
<br />
<RaisedButton
type="submit"
fullWidth
primary
label={SEARCHVIEW_SEARCH}
/>
</Menu>
</form>
);
};
그러나에 ... 사용자 정의
여전히 작동하지 않습니다. – user7334203
값이 올바르지 않습니다. 그것을 제거하거나 그것을 redux의 변수에 붙이십시오. –
당신이하는 말을 이해할 수 없습니다. 값은 자동 보정 양식에 의해 자동으로 첨부됩니다. 사용중인 경우는 – user7334203