Skip to content

Instantly share code, notes, and snippets.

@kstulgys
Created March 9, 2018 04:41
Show Gist options
  • Save kstulgys/f0946fd3aff83f3bf365f2bda9fec195 to your computer and use it in GitHub Desktop.
Save kstulgys/f0946fd3aff83f3bf365f2bda9fec195 to your computer and use it in GitHub Desktop.
handleChange = (e) => {
const { name, value } = e.target
this.setState((prevState, props) => ({
[name]: value,
}));
const lbm = this.state.kg -(this.state.kg * (this.state.fp / 100))
const bmr = 370 + (21.6 * this.state.lbm)
this.setState((aprevState, props) => ({
lbm,
bmr
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment