People got stuck figuring out confusing nested destructuring syntax before they really understood what was happening with the basic examples, so it ended up being more of a discussion of exactly how it worked at the end (I don't think any pair got more than 2 or 3 of the examples finished).
Workshop
We should create a new morning challenge specific to practical destructuring and how it's often used in React.
Basic param destructuring ({ title, children }) => ...
Destructuring inside a function: { title } = this.props
Default parameters ({ title = "My title" } ) => ...
We did Diet Pattern Matching for FAC12 and it didn't go super well.
People got stuck figuring out confusing nested destructuring syntax before they really understood what was happening with the basic examples, so it ended up being more of a discussion of exactly how it worked at the end (I don't think any pair got more than 2 or 3 of the examples finished).
Workshop
We should create a new morning challenge specific to practical destructuring and how it's often used in React.
({ title, children }) => ...
{ title } = this.props
({ title = "My title" } ) => ...
({ res: { data: { name } } }) => ...
({ title, ...rest }) => <Thing title={title}><Other {...rest} /></Title>