Open NullVoxPopuli opened 6 years ago
to maybe eliminate the need for setState all together.
// something like: function tracked(target, name, descriptor) { // logic return { ...descriptor, get() { descriptor.value; } set(val) { this.setState(name, val); } } } class Whatever extends React.Component { @tracked fromDate; }
this is pretty legit: https://codesandbox.io/s/j24oo3z823
state updates asyncily by doing this.property = value
this.property = value
completly omitting the class property value and keeping everything in state:
to maybe eliminate the need for setState all together.