Last active
November 5, 2018 17:20
-
-
Save redgeoff/f2b3d309b42edef0db31f0071bdbe26f to your computer and use it in GitHub Desktop.
Autogenerating Forms Old - Mounting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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