I've created a Store called RegistrationStore and added this to react component
RegistrationStore.mixin
The first time storeDidChange is called everything works as expected. I have a child component that calls the parent component when a button is clicked and I ran into this problem.
TypeError: _this.storeDidChange is not a function
at Store.mixin.componentDidMount.listener (Store.js:59)
at Store.EventEmitter.emit (events.js:99)
at Store.emitChange (Store.js:154)
at Store.<anonymous> (RegistrationStore.js:46)
at Store.<anonymous> (Store.js:14)
at Dispatcher.$Dispatcher_invokeCallback (Dispatcher.js:220)
at Dispatcher.dispatch (Dispatcher.js:195)
at Action.Biff.createActions.storeSectionFields [as callback] (RegistrationAction.js:41)
at React.createClass.onSectionSubmit (ModuleRegistrationComponent.jsx:88)
at React.createClass.submit (SectionComponent.jsx:56)
here is my onSectionSubmit
onSectionSubmit: function(model,transition){
var data = [];
this.state.fields.map(function(field){
if( model[ field._id ] ){
if( field.type === 'dropdown' ){
data.push( {_id : field._id, value : model[field._id].split(',') } );
}else{
data.push( { _id : field._id, value : model[field._id] });
}
}
});
// Here is where the error happens.
RegistrationAction.storeSectionFields( data );
},
I've created a Store called RegistrationStore and added this to react component
The first time storeDidChange is called everything works as expected. I have a child component that calls the parent component when a button is clicked and I ran into this problem.
here is my onSectionSubmit
This is my store and my action