Skip to content

Instantly share code, notes, and snippets.

@kasprownik
Last active February 3, 2016 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasprownik/e8331d8674027ab4fe37 to your computer and use it in GitHub Desktop.
Save kasprownik/e8331d8674027ab4fe37 to your computer and use it in GitHub Desktop.
// src/components/Form.js
import React, {PropTypes} from 'react';
export default React.createClass({
//...
childContextTypes: {
update: PropTypes.func,
reset: PropTypes.func,
submit: PropTypes.func,
values: PropTypes.object
},
getChildContext() {
return {
update: this.props.update,
reset: this.props.reset,
submit: this.submit,
values: this.props.values
};
},
//...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment