File: tsxFragmentReactEmit.js

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (32 lines) | stat: -rw-r--r-- 1,320 bytes parent folder | download | duplicates (5)
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
//// [file.tsx]
declare module JSX {
	interface Element { }
	interface IntrinsicElements {
		[s: string]: any;
	}
}
declare var React: any;

<></>; // no whitespace
<    ></   >; // lots of whitespace
< /*starting wrap*/ ></ /*ending wrap*/>; // comments in the tags
<>hi</>; // text inside
<><span>hi</span><div>bye</div></>; // children
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
<>#</>; // # would cause scanning error if not in jsxtext

//// [file.js]
React.createElement(React.Fragment, null); // no whitespace
React.createElement(React.Fragment, null); // lots of whitespace
React.createElement(React.Fragment, null); // comments in the tags
React.createElement(React.Fragment, null, "hi"); // text inside
React.createElement(React.Fragment, null,
    React.createElement("span", null, "hi"),
    React.createElement("div", null, "bye")); // children
React.createElement(React.Fragment, null,
    React.createElement("span", null, "1"),
    React.createElement(React.Fragment, null,
        React.createElement("span", null, "2.1"),
        React.createElement("span", null, "2.2")),
    React.createElement("span", null, "3")); // nested fragments
React.createElement(React.Fragment, null, "#"); // # would cause scanning error if not in jsxtext