brianvaughn
Joined 12 years ago
Joined 12 years ago
It was a last minute idea and I'm excited about how it turned out.
Sounds like you're talking about extensions in general, but for what it's worth- React DevTools doesn't require any super deep permissions¹ and all of the source code is in the open².
¹ https://github.com/bvaughn/react-devtools-experimental/blob/...
² https://github.com/bvaughn/react-devtools-experimental/tree/...
Just in case there's any misunderstanding- (I don't think there is, but just being safe)- context isn't implicit. You have to opt into it either by using the `<Consumer>` component or a HOC that injects a context prop.
The biggest one is probably adding event listeners or setting up subscriptions (which can cause memory leaks).
Here are some others: https://github.com/reactjs/rfcs/blob/master/text/0006-static...
> Is it correct to say that `getSnapshotBeforeUpdate` is named to indicate what you were supposed to use `componentWillMount` for?
No. `getSnapshotBeforeUpdate` is not really related to `componentWillMount`. It relates more to what people were using `componentWillUpdate` for.
I did not mean to imply that you would need to step through every minor version though. I was just saying that- if you were using e.g. 15, update to the latest 15 release (15.6.2) and fixing warnings in it before updating to 16.
Not if you use a HOC (e.g. `withContext(Component)`) like a couple of the docs examples showed.
> Additionally, the semantics of having a consumer's props.children be an immediately invoked function are a little bit unintuitive to me.
That's fair! I would encourage you to give it a chance though. I think it's a pattern that really grows on you after a short time. :)