Why did we build React? – React Blog (2024)

This blog site has been archived. Go to react.dev/blog to see the recent posts.

There are a lot of JavaScript MVC frameworks out there. Why did we build Reactand why would you want to use it?

React isn’t an MVC framework.

React is a library for building composable user interfaces. It encouragesthe creation of reusable UI components which present data that changes overtime.

React doesn’t use templates.

Traditionally, web application UIs are built using templates or HTML directives.These templates dictate the full set of abstractions that you are allowed to useto build your UI.

React approaches building user interfaces differently by breaking them intocomponents. This means React uses a real, full featured programming languageto render views, which we see as an advantage over templates for a few reasons:

  • JavaScript is a flexible, powerful programming language with the abilityto build abstractions. This is incredibly important in large applications.
  • By unifying your markup with its corresponding view logic, React can actuallymake views easier to extend and maintain.
  • By baking an understanding of markup and content into JavaScript, there’sno manual string concatenation and therefore less surface area for XSSvulnerabilities.

We’ve also created JSX, an optional syntaxextension, in case you prefer the readability of HTML to raw JavaScript.

Reactive updates are dead simple.

React really shines when your data changes over time.

In a traditional JavaScript application, you need to look at what data changedand imperatively make changes to the DOM to keep it up-to-date. Even AngularJS,which provides a declarative interface via directives and data binding requiresa linking function to manually update DOM nodes.

React takes a different approach.

When your component is first initialized, the render method is called,generating a lightweight representation of your view. From that representation,a string of markup is produced, and injected into the document. When your datachanges, the render method is called again. In order to perform updates asefficiently as possible, we diff the return value from the previous call torender with the new one, and generate a minimal set of changes to be appliedto the DOM.

The data returned from render is neither a string nor a DOM node — it’s alightweight description of what the DOM should look like.

We call this process reconciliation. Check outthis jsFiddle to see an example ofreconciliation in action.

Because this re-render is so fast (around 1ms for TodoMVC), the developerdoesn’t need to explicitly specify data bindings. We’ve found this approachmakes it easier to build apps.

HTML is just the beginning.

Because React has its own lightweight representation of the document, we can dosome pretty cool things with it:

  • Facebook has dynamic charts that render to <canvas> instead of HTML.
  • Instagram is a “single page” web app built entirely with React andBackbone.Router. Designers regularly contribute React code with JSX.
  • We’ve built internal prototypes that run React apps in a web worker and useReact to drive native iOS views via an Objective-C bridge.
  • You can run Reacton the serverfor SEO, performance, code sharing and overall flexibility.
  • Events behave in a consistent, standards-compliant way in all browsers(including IE8) and automatically useevent delegation.

Head on over to https://reactjs.org to check out what we havebuilt. Our documentation is geared towards building apps with the framework,but if you are interested in the nuts and boltsget in touch with us!

Thanks for reading!

Why did we build React? – React Blog (2024)
Top Articles
7 tips to develop a money mindset for your financial goals
Log queries | Grafana Loki documentation
Evil Dead Rise Showtimes Near Massena Movieplex
Chalupp's Pizza Taos Menu
The Potter Enterprise from Coudersport, Pennsylvania
Lenscrafters Westchester Mall
Osrs But Damage
Mlifeinsider Okta
Strange World Showtimes Near Cmx Downtown At The Gardens 16
Missing 2023 Showtimes Near Landmark Cinemas Peoria
Keniakoop
6th gen chevy camaro forumCamaro ZL1 Z28 SS LT Camaro forums, news, blog, reviews, wallpapers, pricing – Camaro5.com
Otterbrook Goldens
Daily Voice Tarrytown
How pharmacies can help
TBM 910 | Turboprop Aircraft - DAHER TBM 960, TBM 910
Talbots.dayforce.com
V-Pay: Sicherheit, Kosten und Alternativen - BankingGeek
Robeson County Mugshots 2022
Toyota Camry Hybrid Long Term Review: A Big Luxury Sedan With Hatchback Efficiency
Diakimeko Leaks
Tripadvisor Napa Restaurants
Gas Buddy Prices Near Me Zip Code
Living Shard Calamity
kvoa.com | News 4 Tucson
Pensacola Tattoo Studio 2 Reviews
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Pixel Combat Unblocked
1636 Pokemon Fire Red U Squirrels Download
Abga Gestation Calculator
Jailfunds Send Message
Superhot Free Online Game Unblocked
Spirited Showtimes Near Marcus Twin Creek Cinema
Lincoln Financial Field, section 110, row 4, home of Philadelphia Eagles, Temple Owls, page 1
Ellafeet.official
Hermann Memorial Urgent Care Near Me
Domino's Delivery Pizza
Pitchfork's Top 200 of the 2010s: 50-1 (clips)
Linda Sublette Actress
18 terrible things that happened on Friday the 13th
Low Tide In Twilight Manga Chapter 53
Www.craigslist.com Waco
US-amerikanisches Fernsehen 2023 in Deutschland schauen
Mbfs Com Login
Craigslist Central Il
412Doctors
N33.Ultipro
Enjoy Piggie Pie Crossword Clue
Plasma Donation Greensburg Pa
Bbwcumdreams
Craiglist.nj
Frank 26 Forum
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 6782

Rating: 4.9 / 5 (59 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.