reactjs - The component handles the form submission by calling its own callback? What does calling its own callback mean in this context? -
i learning flux architecture reactjs, while reading article: https://medium.com/brigade-engineering/what-is-the-flux-application-architecture-b57ebca85b9e
i can not seem author means "component handles form submission calling own callback" in following context:
// saving new todo calls '_onsave' callback var header = react.createclass({ /** * @return {object} */ render: function() { return ( <header id="header"> <h1>todos</h1> <todotextinput id="new-todo" placeholder="what needs done?" onsave={this._onsave} /> </header> ); },
the term "callback" may incorrect here, think means he's passing function defined in header
class, this._onsave
child component todotextinput
when todotextinput
submitted, function inside header
called , therefore todotextinput
doesn't have know it.
Comments
Post a Comment