On Pure Components

Owen Abbott
Dec 14, 2020

I’m having trouble right now with my space invaders game. In order to Optimize the speed of the app, I changed all components to PureComponents.

We never really learned what ‘pureComponents’ actually *do* in the bootcamp, so I’ve been fiddling around myself to figure out how they work.

The tutorials on the internet vaguely say that they don’t re-render as often unless they detect a change. I’m not sure how that’s different from regular components — I guess they’re re-rendering each time the page refreshes? I don’t know. Will have to look into this later, I suppose.

So far, everything works except my Bunkers, which no longer register a change when a block is broken. I feel this is because they’re nested two layers deep in other components. Will fiddle around with that and report back at some point in the following blogs.

--

--