Questions

What is React Pros and Cons:

Pros:

  • easy to maintain isolated components in React and they are easy to reuse;(star)

  • convenient architecture – One-way data flow provides maintainability and efficient arrangement of data and DOM elements;

  • lightweight among the ones that are widely used today;

  • component-based architecture can be implemented;

  • ranked 1st most popular front-end javascript framework in State Of JS survey;(star)

  • backward compatibility – Transitioning or migrating from older to new versions is fairly easy in react using CodeMods;

  • rich community;

  • a lot of experienced developers.

Cons:

  • use JSX proprietary technology (add extra abstractions over HTML, needs a transpiler for it);

  • Not a complete solution. (To have a complete solution React should be used with other staff like Routing, State management system, etc.)

  • Not opinionated in terms of application structure. Code organization methodology should be defined at the beginning of the project.

React meets the functional programming concepts?

React is a framework that represents the multi-paradigm nature of JavaScript. You’ll find OOP (your class components inherit from Component or PureComponent), Prototype-based programming (after all, the class keyword is ultimately just syntactic sugar - it boils down to prototypes), and lots of love for Functional Programming.

Functional programming concepts in React/Redux:

  • Pure Functions (dumb functional components are pure functions, Redux reducer is PF also)

  • Immutability (Redux dataflow, state in React components)

  • Higher-Order Functions (HOCs is a popular react pattern, withRouter and connect - popular HOCs)

  • Functions composition (function compose in Redux)

  • Currying (connect and redux-thunk in Redux)

  • Memoization (reselect lib, useMemo hook)

What are React new features?

The current React version is 17.0.2

No major breaking changes. The main goal is to have the ability to use two versions of React in one app, so that you will also have an option to upgrade your app piece by piece. For example, you might decide to migrate most of your app to React 18, but keep some lazy-loaded dialog or a subroute on React 17.

The following features were released in this version:

  • Changes to Event Delegation In React 17, React will no longer attach event handlers at thedocumentlevel under the hood. Instead, it will attach them to the root DOM container into which your React tree is rendered (these changes allows you to have 2 versions of the React in one app)

  • New JSX Transform New JSX transpiler (ability to use JSX without importing React, Depending on your setup, its compiled output may slightly improve the bundle size, It will enable future improvements that reduce the number of concepts you need to learn React)

  • Remove event pooling (don't nullify event- object between events)

  • Native Component Stacks (improve error trace in production mode)

  • Effect Cleanup Timing (In React 17, the effect cleanup function always runs asynchronously — for example, if the component is unmounting, the cleanup runs after the screen has been updated.)

Last updated

Was this helpful?