This repository was archived by the owner on Aug 23, 2022. It is now read-only.
React Redux Form v0.13.6
Custom Components and createFieldClass()
- If you specify the
.componentMap
in thedefaultProps
argument (second arg) ofcreateFieldClass(propsMap, defaultProps)
, it will now recognize custom components based on their constructors, and not on their.displayNames
(which are minified in production builds). #261 #224 #176 #161 #65
import CustomInput from '../somewhere/custom-input.js';
import { createFieldClass, controls } from 'react-redux-form';
// BEFORE:
const CustomField = createFieldClass({
CustomInput: controls.text,
});
CustomField.displayName = 'customField'; // < 0.13.6 workaround
// AFTER:
const CustomField = createFieldClass({
CustomInput: controls.text,
}, {
componentMap: {
CustomInput: CustomInput // recognize custom input from constructor
}
});
// SHORTHAND:
const CustomField = createFieldClass({
CustomInput: controls.text,
}, {
componentMap: { CustomInput }
});
Bug Fixes