Advertisement
Guest User

Untitled

a guest
May 25th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. 1)What is ReactJS? ReactJS is a JavaScript library that combines the speed of JavaScript and uses a new way of rendering webpages, making them highly dynamic and responsive to user input. The product significantly changed the Facebook approach to development. After the library was released as an open-source JavaScript tool in 2013, it became extremely popular due to its revolutionary approach to programming user interfaces.
  2. 2)React.js operates with components. Components are the building blocks of any React app and a typical React app will have many of these. Simply put, a component is a JavaScript class or function that optionally accepts inputs i.e. properties(props) and returns a React element that describes how a section of the UI (User Interface) should appear.
  3. 3)Functional and class components. Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen. Such components are called “function components” because they are literally JavaScript functions. The above two components are equivalent from React’s point of view. The main difference between functional and class components is that class component has its own local state while functional doesn’t. Also the class component by default is re-rendered each time its state or props are changed.
  4. 4)Component lifecycle. React component lifecycle consists of three phases: mounting, updating and unmounting. 1)Constructor. If your component does not have an state management framework like Redux, this is where state is initialized. It is also where super(props) is called so the constructor function has access to this.props. 2)componentDidMount() is invoked immediately after a component is mounted (inserted into the tree). If you need to load data from a remote endpoint, this is a good place to instantiate the network request. 3)componentDidUpdate() is invoked immediately after updating occurs. This method is not called for the initial render. 4)componentWillUnmount() is invoked immediately before a component is unmounted and destroyed.
  5.  
  6.  
  7. Pros
  8. 1)Virtual DOM is the first thing that will come into your mind if you have previously studied the features of this JavaScript library. DOM contains the description of the hierarchical structure of a web document. Updating the browser isn’t as simple as just regenerating the DOM whenever something changes. If Gmail did this, for example, you would be constantly annoyed when the entire browser window refreshed in order to display a new message, wiping out the email you were composing. Since modern web apps are pretty complex, updating DOM in a “traditional” way may cause lack of performance. The Virtual DOM is a copy of a real DOM that can be used for updating the small parts of a web app without affecting other parts of the UI. As a result, updates are performed very quickly, and developers can create complex applications that work without any lags.
  9. 2)JSX. ReactJs introduces special JavaScript code preprocessor step adding XML-like syntax into JavaScript. It helps to conduct building readable code, to save it in one verified file. Possibility of dropping HTML in render function without concatenating strings is excellent. Through using a particular JSX Transformer HTML is converted into functions.
  10. 3)Event handling. In react event handlers will be passed instances of SyntheticEvent, a cross-browser wrapper around the browser’s native event. It has the same interface as the browser’s native event, including stopPropagation() and preventDefault(), except the events work identically across all browsers. So in general, event handling in react is pretty simillar to native javascript code.
  11. 4)React Native. React Native is a JavaScript framework for writing real, natively rendering mobile applications for iOS and Android. It’s based on React, but instead of targeting the browser, it targets mobile platforms. In other words: web developers can now write mobile applications that look and feel truly “native,” all from the comfort of a JavaScript library that we already know and love. Similar to React for the Web, React Native applications are written using JSX.
  12.  
  13. Cons
  14. 1)React is library dependent. ReactJs support of quite a lot of external libraries means to have it lacks quite a lot of native libaries, external libraries helps one to use the HTML and CSS functionalities to gether and build it into JSX. Despite being lightweight, ReactJs quintessentially is a UI library. There is only so much it can do to enhance performance and robustness of a web app through its core functionalities.
  15. 2)Easy to learn – hard to master. High pace of development can be mentioned as one of the React’s advantages. Unfortunately, this medal has two sides. Since the environment changes so fast, it may be hard for some developers to adapt to all these changes and feel comfortable with all the continuous updates.
  16. 3)Relatively poor documentation. The problem with documentation traces back to constant releases of new tools. Different and new libraries like Redux and Reflux are promising to accelerate the work of a library or improve the entire React ecosystem. At the end, developers struggle with integrating these tools with ReactJS. Some members of the community think that React technologies are updating and accelerating so fast that there is no time to write proper instructions.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement