dist
folder with the new files and make it ready to be used as a dependency?
hey guys I'm trying to create a custom SearchField
, but my code keeps failing in this block:
if (this.props.searchField) {
searchField = this.props.searchField({
search: this.handleKeyUp,
defaultValue: this.props.defaultSearch,
placeholder: this.props.searchPlaceholder
});
if (searchField.type.name === _SearchField2.default.name) {
searchField = _react2.default.cloneElement(searchField, {
ref: 'seachInput',
onKeyUp: this.handleKeyUp
});
} else {
searchField = _react2.default.cloneElement(searchField, {
ref: 'seachInput'
});
}
} else {
searchField = _react2.default.createElement(_SearchField2.default, { ref: 'seachInput',
defaultValue: this.props.defaultSearch,
placeholder: this.props.searchPlaceholder,
onKeyUp: this.handleKeyUp });
}
particularly on the line searchField.type.name === _SearchField2.default.name
because the type
is undefined
for my custom component .. I have no idea where this type is being populated from
when I implement my own custom component and feed it through the options like so:
const options = {
searchField: props => (<CustomListSearchBar {...props} />),
};
it completely fails
SearchField
here it picks up a type!
SearchField
implementation into my CustomListSearchBar
and that doesn't work either
componentWillReceiveProps(nextProps) {
let { uiSchema: { table: { focusOnAdd } } } = nextProps;
this.adding = focusOnAdd && nextProps.formData && this.props.formData && nextProps.formData.length > this.props.formData.length
}
componentDidUpdate() {
if (this.adding) {
let { table: { refs: { body } } } = this.refs;
body.handleEditCell(this.props.formData.length, 1);
}
}