techsin101
Joined 11 years ago
Joined 11 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
Ultimately, I think even the choice of naming something and using a single letter communicates your intentions. If you make something a single letter then you're telling the reader that do not even worry about this variable it is just passing through, but if you need something your communicating your intentions of using this variable in the future it is more permanent in a sense