Hacker News new | past | comments | ask | show | jobs | submit login

Two days ago I made a comment about HN evangelizing React, but never posting any good/current getting started points. I officially stand corrected.

I'm still curious about reasons to invest time in learning it over plain old javascript.




The React docs were recently rewritten by Dan Abramov ([0]). He's also spent a lot of time building Create-React-App ([1]), a project creation tool that provides all the build handling for you so you can just jump in and start writing code. CRA has been compared to a boilerplate, but unlike most boilerplates, it's designed so that you can keep upgrading one dependency and get all the build updates as they come out ([2]). It's a great way to start using React.

Besides the React docs, the authors of a book called Full Stack React are currently doing a tutorial series called "30 Days of React" ([3]), which has been excellent so far. Covers a lot of key topics. Also see my main comment above for my list of links to React tutorials and resources.

As for reasons to use React: I could talk about it for quite a while, but I'll stick with just one for now. Going from imperatively poking around at the DOM and toggling things to simple declaring what the UI output should be based on props this component was given and state this component controls is a huge improvement. It takes some time to switch your mind around to thinking in that style, but once you do, your code becomes much more predictable and straightforward.

[0] https://facebook.github.io/react/

[1] https://github.com/facebookincubator/create-react-app

[2] https://www.reddit.com/r/reactjs/comments/5gt2c4/you_dont_ne...

[3] https://www.fullstackreact.com/30-days-of-react/


I would add in addition to being more predictable it's significantly easier to test. If you fully embrace having stateless components, those components take inputs(props) and have a straightforward output (the elements they generate) which shouldn't have any side effects. A unit test can easily capture this behavior rather than building up a large test suite to test a button click.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: