react源碼解析
A declarative, efficient, and flexible JavaScript library for building user interfaces.
declarative:聲明式。React將此作為第一個詞,可見其重要性。declarative對應imperative(命令式),移步這裏看看什麽是 declarative javascript.
對於react,declarative的含義是:declarative UI.
Declarative views make your code more predictable, simpler to understand, and easier to debug.
這說的是JSX語法,能夠在JS裏面直接寫html和css,是一次大膽的創新。JSX讓人寫前端代碼寫得直呼過癮。
React is flexible and can be used in a variety of projects. You can create new apps with it, but you can also gradually introduce it into an existing codebase without doing a rewrite.
你沒有必要非在整個網頁或者整個項目中使用react。你可以只在一個dom節點中使用,然後慢慢地去做重構。所以,使用react和使用jquery,angular並不沖突。
Tags: understand efficient building existing library
文章來源: