What is React?
React is a UI library developed at Facebook. It is a Javascript library for building user interfaces. It is used by Facebook and Instagram. JSX is the extension for the React.
React provides two features
- Rendering DOM (Rendering the model to the DOM and keeping the DOM synchronized with changes to the model).
- Events.
What is JSX?
It is a Javascript XML syntax transform. JSX supports xml like syntax inline in javascript. Each element is converted into a javascript function call.
Components
A react consists of set of components.
- PROPS
- STATE
The inputs to the components are referred as properties called as props and state, the difference between two is the state can change at any time.
To render an any element we use renderComponent method.
Example for renderComponent
In the above syntax, the first argument is the component we want to render, the second argument is the DOM node it should bind to. We can use the createClass method to create custom component classes. It takes an object of specifications as it’s argument.
0 Comments
If you have any doubts,please let me know