Road to React: 7 things I learned about React

ReactJS is a JavaScript library for building user interfaces.

  1. React is memory-efficient and renders things quickly because React renders only what’s changed.
Source: Hendrik Swanepoel’s “Thinking in React” video

2. React increases it performance by creating a “virtual DOM” or writing out a full render virtually. It then compares the difference between the virtual render and what’s currently existing on the DOM (Document Object Model, which represents a structured document via objects), and creates a patch. React made the “virtual DOM” idea popular.

3. Working directly with the existing DOM hurts performance because a real DOM contains lots of heavyweight parts.

4. According to a blog post by Tony Free, there are two ways to check if data has changes: 1) dirty checking 2) observer for state change via libraries like React.

Source: https://vladmihalcea.com/2014/08/21/the-anatomy-of-hibernate-dirty-checking/

5. Tony’s blog explained how React library works perfectly. He says React creates a lightweight tree using JavaScript objects. This tree will represent a DOM tree and based on this tree, React will automatically write HTML to be inserted into HTML elements for the browser to render. React is not a framework, there it can’t be compared to Angular and Ember.

6. React was created in 2011 by a Facebook engineer named Jordan Walke and it is open-sourced. If you want to see Jordan speak, watch this video: https://www.youtube.com/watch?v=GW0rj4sNH2w

7. Some people do not use React because it is backed by a major tech corporation, but it seems like Facebook has reacted to these feedback and updated its policies. Read more here: https://medium.com/bits-and-pixels/a-compelling-reason-not-to-use-reactjs-beac24402f7b#.pe6m94r1o and https://code.facebook.com/posts/1639473982937255/updating-our-open-source-patent-grant/.

Show your support

Clapping shows how much you appreciated Regii’s story.