Recent submissions

Comment · 7 years ago
Thank you for elaborating.
Comment · 7 years ago
Glad the tutorial is helpful! :)

It was a last minute idea and I'm excited about how it turned out.

Comment · 7 years ago
That's definitely not the intent.
Comment · 7 years ago
It's a little scary to upload a completely new version, when you know there's that many weekly active users that are going to be hammering away on it soon.
Comment · 7 years ago
Comment · 7 years ago
You might still check out DevTools at some point :) They do a lot of small things that can be nice.
Comment · 7 years ago
Doesn't sound like it. React DevTools uses the `postMessage` API to communicate, not websockets.
Comment · 8 years ago
Sunil has also worked at Yahoo on maps.yahoo.com, specifically on tooling to manage styling.
Comment · 8 years ago
> s everybody knows about the implicit context(s) that also affect component behavior.

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.

Comment · 8 years ago
Yes, but then that prop would need to be passed down explicitly through every component. This would require a _lot_ of boilerplate.
Comment · 8 years ago
> In your experience, what are the kind of things that people do in `componentWillMount` that they shouldn't be doing?

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.

Comment · 8 years ago
I'm not sure why you would need to upgrade your app in that case. Is the problem that our documentation only reflects the latest release?
Comment · 8 years ago
Upgrading any project after 3 years of inactivity would be difficult, regardless of framework.

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.

Comment · 8 years ago
> Well, I tend to make a lot of very small stateless components. If a component is 1-6 JSX tags, the new context API represents a boilerplate overhead of between 100 and ~17%.

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. :)

Comment · 8 years ago
I'm curious why the theme example I mentioned in my earlier comment- (and showed in the docs)- doesn't qualify as "useful" to you. Another example would be using context to share the selected language/locale between all of the localized components in an application.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton