W3C TPAC 2021: CSS WG Updates

At (the ongoing) TPAC 2021 — the W3C Annual Conference — the CSS Working Group provided two video updates that summarize some of the ongoing work they’ve been doing. Perfect way to get up to speed in less than 10 minutes Improving CSS Architecture with Cascade Layers, Container Queries, Scope In this video Miriam Suzanne …

React Binding Patterns: 5 Approaches for Handling this

Cory House: There are at least five ways to handle the this context in React. Let’s consider the merits of each approach. Use React.createClass Bind in Render Use Arrow Function in Render Bind in Constructor Use Arrow Function in Class Property Currently I’m mostly using Approach 4 (“Bind in Constructor”), but Approach 5 (“Arrow Function …

ES6 ES2015 Arrow Functions and this

Why you’d want to use arrow functions (next to them being shorter to type): Arrow functions will maintain the this value of the enclosing context Yes, this will work just fine: function Wilto() { this.age = 32; setInterval(() => { this.age++; console.log( “I am now ” + this.age + ” years old”); }, 3000 ); …