Implementing SharePoint Operations Using React.js - Part One
React is a front-end library developed and licensed by Facebook.
It is famous for 'V' in MVC, which handles view layer on the web.
Using ReactJS, we can build reusable components.
The library files referenced are,
The core functionality is written on JSX. Here, Babel compiler is used to transform the JSX content to JS.
JSX content is embedded with in the script tag, which is of the type text/babel.
JSX is faster, type safe and object-oriented programming language.
JSX is not the globally accepted standard, so it is not supported on browsers.
ComponentsComponents help us split the code/UI in multiple pieces. The component contains a constructor and methods.
StateState stores the data. The data can be in multiple forms. The data can be a string, number, array, etc.
PropsProps are attributes defined in the components. These are immutable and passed as arguments for rendering the HTML. propTypes are used for validating the props.
RenderIt is a method, which returns the HTML content that needs to be displayed on the page.
ConstructorConstructor declares the variables, handlers and the methods.
Component Life cycleThere are predefined set of methods executed when the component is executed. The life cycle methods are componentWillMount, componentDidMount, componentWillReceiveProps, shouldComponentUpdate, componentWillUpdate, componentDidUpdate, and componentWillUnmount.