I have a form component as follows:
var React = require('react'), ReactRedux = require('react-redux'); var Form = React.createClass({ render: function(){ return ( <form onsubmit={this.onsubmit} action={this.props.action}> {this.props.children} </form> ); },
Inside the component rendering, I have <Form id="paymentform" ref="form" action="/self"> .
I can not do this.refs.form.submit(); because this.refs.form points to a Connector. As I understand it, connectors are funnels for gearboxes for updating props, however this cannot cause a submit call.
A use case basically consists in transferring the form to another action that will start using the form component, for example, XHR checks and requests.
I can do React.findDOMNode(this.refs.form).submit() , but this does not answer the actual question about getting the component method from the outside.
What am I doing wrong here?
source share