PLAY PODCASTS
Michael Chan Encapsulates State
Season 3 · Episode 8

Michael Chan Encapsulates State

Michael Chan talks about co-location, encapsulation, and CSS grid.

Chats with Kent C. Dodds · Michael Chan, Kent C. Dodds

May 19, 202039m 30s

Audio is streamed directly from the publisher (cdn.simplecast.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

One of the things Michael loves about React is that it's a lot easier to make a black box of abstraction with iron-clad React components that don't leak.

Something that concerns Michael deeply about any technology is when we put too much inside of it. We saw this pretty early on in React, where everyone was taking all manner of state and putting it into Redux. We have to think about the principle of co-location and the fact that the closer you put related things together, the easier it will be to maintain in the longterm.

In React, we've got this excellent encapsulation model that allows us to do this thing for the first time. But, you have to be very strict about what you let in there. The encapsulation model is only as good as you are at encapsulating a single piece of information.


Homework

  • Take one of your small css-in-js components and use regular css to back it up.

Guest: Michael Chan

Host: Kent C. Dodds

Topics

reactdevcodecsstechstateprogramming