10 Things you need to know about React

React: (beta article)

  1. React not a framework:

React is just a library & you need to make all decicions. It focous on helping u to build an attractive user interface using components.

2) JSX

When looking at React Examples:

Some people dont fancy entier markup code as function. React.createElemnt(components, props, …children)funciton.

3) JavaScript:

To generate markup dynamically in React you also use JS:

4) React declarative:

React u use declarative style to write ur compnents. example below

8) You Separate the concerns:

In react u keep HTML, Js, CSS. For many year s we split JS, HTML, & CSS into different fiels. I often get questions if I consider this “lack of separation” strange. But what’s strange for me are the examples people often give to defend the strategy of keeping HTML and JS separate:

“If you keep HTML and JS in separate files you can easily replace the HTML and keep the JS intact”.

It doesn’t work that way if you think about it. Most changes to the HTML structure require refactoring of JS logic.

9) Data goes down

In React data goes down the tree of the components. props. From JSX point view are HTML atttibutes.

10) State

its needed to create a stateful component where the state is changing over time.

--

--