React input Revocation

Source: Internet
Author: User

  1. Functions that can be used in the destroy phase:
    Componentwillunmount: Cleanup operations, such as timers and event listeners, before the components are removed. Because these functions are manually added by the developer, react does not know that it must be cleaned manually.

  2. Instance
    The first way: in Render, the previous page is removed, reflected in the page, is to delete it.
    <! DOCTYPE html>

    Input other does not trigger



    When I enter 123,



    The second type is to use a function provided by react Unmountcomponentatnode

    <! DOCTYPE html>
    if (Event.target.value = = "123") {React.unmountcomponentatnode (document.getElementsByTagName ("body") [0]); Return } this.setstate ({name:event.target.value}); }, Render:function () {return <div>

React input Revocation

Related Article

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.