Skip to content

Instantly share code, notes, and snippets.

@redgeoff
Last active November 5, 2018 17:20
Show Gist options
  • Save redgeoff/f2b3d309b42edef0db31f0071bdbe26f to your computer and use it in GitHub Desktop.
Save redgeoff/f2b3d309b42edef0db31f0071bdbe26f to your computer and use it in GitHub Desktop.
Autogenerating Forms Old - Mounting
componentDidMount() {
const form = compiler.newComponent(definition);
this.setState({ form });
this.loadValues(form);
form.on("submit", this.handleSubmit);
form.on("reset", this.handleReset);
}
componentWillUnmount() {
// Remove all listeners to prevent listener leaks
this.state.form.destroy();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment