DEV Community

Discussion on: Why should I care about React?

smalluban profile image
Dominik Lubański

If you don't mind, I have a couple of thoughts about the article. It looks very well, but it might create some confusing impressions:

Web Components lets you do just that without any frameworks… as long as you only need to support later versions of Chrome, Firefox, and Opera.

It just not true. Yes - native support, for now, is shipped in Chrome, Safari, Firefox, Opera, Internet Browser, UC Browser, and many more, but not in IE or Edge. However, with shims and polyfills provided by the community you can try to use web components today! Especially polyfill for creating custom elements covers almost 100% of the specification.

You write something that looks like HTML directly in your React code. It’s called JSX.

Someone who has no idea what the React is may have one thought after reading that - JSX is an integral part of the library, and it has to be used. It's not true, even though it is still recommended. It might be a good idea to point it out.

And the sentence before that code snippet... A newbie can understand, that with React is possible to just put a new fancy created element in HTML document. You don't explain, that it has to be used with the render method: ReactDOM.render().

I would also recommend simplifying your code examples by hiding not important implementation details. In the code snippet, you can import your methods, which fetches GPS data or update something, and only show the DOM part from vanilla example and React part from the latter. Your first example is cut off in the middle of the function (?). You also compare it to the react example before you show the react example. If they would be shorter you could show them one after another.

And the last thing. Your form example in React can be simpler. Lat and Long fields could use one React component, they are almost identical - the only difference is with what callback they call. You can parametrize that with name prop for example.

By the way, I hope I did not offend you. Again, it is nice to read more articles from the DEV community.

raddevon profile image
Devon Campbell Author

Thanks for your feedback, Dominik. I didn't realize I had not included all the code in the first example, so that was extremely helpful! Some of the other feedback will be incorporated into future posts.

I'm not offended. I appreciate your taking the time to read! 😄