ES6 has definitely made coding more efficient by reducing the number of lines, but relying solely on typescript for everything may not be the best approach.
If I were to implement type checking for arguments that have been destructed multiple levels deep, wouldn't it become a bit messy? Perhaps using interfaces for initial checking would suffice, rather than typechecking every single thing. It's important to strike a balance and avoid overusing ES6 for the sake of readability. What are your thoughts on this?
<div>
{response.results.map(({id, name, stock: {day: dayStock, month: monthStock}}) => {
return(
<div>
<p>Item: {name}</p>
<p>Day Stock: {dayStock}</p>
<p>Month Stock: {monthStock}</p>
<br />
</div>
)
})}
</div>
Check out the typescript playground here: https://codesandbox.io/s/v06ml2y130