You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
For the jsx to produce a regular form with the constructed models.
Actual Behavior
In the
node_modules/react-redux-form/lib/utils/resolve-model.js file,
function resolveModel(model, parentModel) {
if (parentModel) {
console.log('parentModel :', parentModel, 'childModel :', model);
if (model[0] === '.' || model[0] === '[') { <------------------ It points to this line over here.
return '' + parentModel + model;
}
if (typeof model === 'function') {
return function (state) {
return model(state, parentModel);
};
}
}
return model;
}
function wrapWithModelResolver(WrappedComponent) {
var ResolvedModelWrapper = function (_PureComponent) {
_inherits(ResolvedModelWrapper, _PureComponent);
function ResolvedModelWrapper() {
_classCallCheck(this, ResolvedModelWrapper);
return _possibleConstructorReturn(this, (ResolvedModelWrapper.__proto__ || Object.getPrototypeOf(ResolvedModelWrapper)).apply(this, arguments));
}
_createClass(ResolvedModelWrapper, [{
key: 'render',
value: function render() {
var _context = this.context,
parentModel = _context.model,
localStore = _context.localStore;
var resolvedModel = resolveModel(this.props.model, parentModel); <------------------------ resolveModel gets called here.
return _react2.default.createElement(WrappedComponent, _extends({}, this.props, {
model: resolvedModel,
store: localStore || undefined
}));
}
}]);
return ResolvedModelWrapper;
}(_react.PureComponent);
ResolvedModelWrapper.displayName = 'Modeled(' + WrappedComponent.displayName + ')';
process.env.NODE_ENV !== "production" ? ResolvedModelWrapper.propTypes = {
model: _propTypes2.default.any
} : void 0;
ResolvedModelWrapper.contextTypes = {
model: _propTypes2.default.any,
localStore: _propTypes2.default.shape({
subscribe: _propTypes2.default.func,
dispatch: _propTypes2.default.func,
getState: _propTypes2.default.func
})
};
return ResolvedModelWrapper;
}
What is peculiar is that when I include console.log statements inside of the resolveModel.js file, I get three different variations of the expected response. Why is that?
So basically I had to set a proper trigger for the NoSearchResults error, so I set that up in a sibling folder called services in a file called checkQueryValidity.js:
And in the file SoundCloudExp.jsx, I replaced SCPromise w/ checkQueryValidity(res) and replaced querySC(res); with dispatch(actions.submit('SoundCloud', checkQueryValidty(res)));
The Problem
The error I'm getting through babel is:
Cannot read property '0' of undefined;
resolveModel
node_modules/react-redux-form/lib/utils/resolve-model.js:32
Steps to Reproduce
Inside of src/components/SoundCloudExp.jsx
Inside of src/index.js
Expected Behavior
For the jsx to produce a regular form with the constructed models.
Actual Behavior
In the
node_modules/react-redux-form/lib/utils/resolve-model.js file,
What is peculiar is that when I include console.log statements inside of the resolveModel.js file, I get three different variations of the expected response. Why is that?
Reproducible Code Example
(please fork from this CodePen template or this CodeSandbox template)
The text was updated successfully, but these errors were encountered: