Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 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



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: