summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/markup/test/doc_markup_events_react_production_16.2.0.html
blob: 032d57539c465f4d8d5cb53c41333535f221497b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />

    <script src="lib_react_16.2.0_min.js"></script>
    <script src="lib_react_dom_16.2.0_min.js"></script>
    <script src="react_external_listeners.js"></script>
  </head>
  <body>
    <h1>doc_markup_events_react_production_16.2.0.html</h1>

    <div id="container"></div>

    <script>
      "use strict";

      /* global React, ReactDOM, externalCapturingFunction, externalFunction */

      class ClickMe2 extends React.Component {
        inlineFunction() {
          alert("inlineFunction");
        }

        render() {
          return React.createElement(
            "div",
            null,
            React.createElement(
              "h3",
              {
                id: "inline",
                onClick: this.inlineFunction
              },
              "Click for inlineFunction"
            ),
            React.createElement(
              "h3",
              {
                id: "external",
                onClick: externalFunction
              },
              "Click for externalFunction"
            ),
            React.createElement(
              "h3",
              {
                id: "externalinline",
                onClick: externalFunction,
                onMouseUp: this.inlineFunction
              },
              "Click for both"
            ),
            React.createElement(
              "h3",
              {
                id: "externalcapturing",
                onClickCapture: externalCapturingFunction
              },
              "Click for externalCapturingFunction"
            ),
            React.createElement(
              "h3",
              {
                id: "doublebind",
                onClick: this.inlineFunction.bind(this).bind(this)
              },
              "Click for inlineFunction bound twice"
            )
          );
        }
      }

      ReactDOM.render(
        React.createElement(ClickMe2),
        document.getElementById("container")
      );
    </script>
  </body>
</html>