When Reactjs met TypeScript

Source: Internet
Author: User

Because my application project is mainly 2B Web application, so the following is not talking about react server rendering and react Navie,

First talk about Reactjs:

    1. React's modular and data unidirectional binding pattern (flux) makes applications easier to develop and maintain.
    2. Compared to Angular,ember's comprehensive framework, react is relatively lightweight (non-packet size), which makes it easier to architect applications or work with other libraries.
    3. The jsx of the view layer seamlessly mixes JS code, which is powerful yet readable, and can be said to have the advantages of integrated declarative programming and imperative programming.
    4. The framework supports an incremental update of the DOM's features to effectively guarantee the performance of the program, and in layman's terms, it is not easy for a general level of people to write poorly performing programs, which is important for organizing large and complex applications.

Besides, typescript.

    1. One of the reasons that a strongly typed programming language is more beneficial to engineering is that it is more fully supported by the IDE. The universe's strongest IDE's VisualStudio not only brings a good programming experience to typescript, but the way of myopia in C # realizes the modularity of the code while preserving JS dynamic language flexibility.
    2. One-click build resolves the issue of compilation compression.
    3. The TSX also provides a good support for react's jsx.

Use Reactjs and Typescrit for a period of time, summed up from the thought of some more practical tip, with you to share, hope can play a role, master Liberal enlighten:

1. How to package the integration into a single JS using R.js vs Compile. Of course, this part can be omitted during the development phase. 2. The component uses an object-oriented approach, referencing WinForm and WebForm object-oriented methods to define the react component (figure) Component base class: A control that has already been written 3. Use the message mechanism to decouple communication between components, try not to reference each other, by eliminating    mechanism to complete.    Flux is the same way of thinking, you can not directly use the Flux library, if mastered the core of flux, with any of the JS event message library can be. This is the EventEmitter2 library. 4. Define the routing mechanism yourself 5. Use the back-end programming plug-in mechanism to decouple the dynamic language features of JS due to the native support plugin.    So just a few packages are needed to implement a simple and practical IOC plug-in function. Control registration:

When Reactjs met TypeScript

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.