Open zacharygolba opened 6 years ago
Thanks for that tip, after reading your explanation it made sense. Sometimes I just use babel presets without knowing what they really do, but do it because it's been ingrained through hours of tutorials and articles you read.
It looks like your already taking advantage of a babel preset that enables class fields proposal. The same trick used to bind
this
to a component classes' event handlers can be used to initialize state!For example:
https://github.com/george-haddad/tool-belt/blob/07632d25e2df3c277fd0cb18459f110bbbb8a1bd/src/components/axfr-check/index.jsx#L29-L39
Can be simplified to: