Comment Comment by techsin101 just from pure api perspective how is setA, setB, setC better than...this.setState({this.state: val})which was already pushing limit of normal behavior which isstate.A = valjust to be revisei went from having to dostate.onlineStatus = 'active'toconst [onlineStatus, setOnlineStatus] = useState('active')Instead of being able to get autocomplete and normal refactoring you would get from plain js.. now you need to add typescript to supplement the mess...const obj = {onlineStatus: 'inactive', shoppingCart: '3899x', lastActive: 1834393939 }obj. [autocomplete anywhere in the project]vs MORE Boilerplate parent techsin101 2 years ago
this.setState({this.state: val})
which was already pushing limit of normal behavior which is
state.A = val
just to be revise
i went from having to do
state.onlineStatus = 'active'
to
const [onlineStatus, setOnlineStatus] = useState('active')
Instead of being able to get autocomplete and normal refactoring you would get from plain js.. now you need to add typescript to supplement the mess...
const obj = {
onlineStatus: 'inactive', shoppingCart: '3899x', lastActive: 1834393939 }
obj. [autocomplete anywhere in the project]
vs MORE Boilerplate