React issues with callback function bindings for---events

Source: Internet
Author: User
Under the guidance of Master, began to react study. This react is very powerful and produces reusable components. Development efficiency is very high, using this development is very normative, there are processes. Can be said to change the traditional front end is a cut figure, using it can be developed and separated back and forth. Parallel development, high efficiency.
This problem is the first time today.
I've bound a function in the event, and it doesn't look like anything. It's normal.
<div id= "Calendar" Onclick={this.selectdate.bind (This)} >
{This.createcalendar ()}
</div>

Change after I add a parameter to the following:
<div id= "Calendar" Onclick={this.selectdate.bind (This,para)} >
{This.createcalendar ()}
</div>

Such a problem is serious, causing the event to bubble when E.target becomes undefined. Once the cancellation of this parameter is resumed. I don't know why, but it's a personal feeling worth noting that the bind in the event has some problems. The internal reason I don't know yet. But
It's still recorded here. If someone, see know why, trouble please inform. If you don't know, it's dangerous to be tied up. That's it, remember first. If I can fix it, there will be a follow-up.

React issues with callback function bindings for---events

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.