Skip to content

Instantly share code, notes, and snippets.

@artificialarea
Last active September 9, 2020 05:24
Show Gist options
  • Save artificialarea/87dfa2ab9041021e1ca534df42a05945 to your computer and use it in GitHub Desktop.
Save artificialarea/87dfa2ab9041021e1ca534df42a05945 to your computer and use it in GitHub Desktop.

https://html-108.vercel.app ... https://github.com/artificialarea/html-108-app

I have some concerns that although the changes to state and subsequent re-renders are as I intended, I suspect I may be erroneously mutating state in the process. I discovered only by accident that if I commented out the entire block of code within setState() and just left it as an empty setState({ }) shell, the state still changed and re-rendered as intended... what the fuck?!? I've committed and deployed it in that state for discussion. Also left a console.log(this.state) in the render() to reflect change in state.


  • Re: handleBeatChange (permalink)
  • if you click on the 'beat-pads' it does what it should, re-rendering beats toggle on/off based on new state. (btw, no audio yet)

  • Re: handlePrivacyChange (permalink)
  • if you click on Private or Public radio button, it changes as it should, rerendering based on new state


--

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment