Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81152 views
1
/**
2
* Copyright 2013-2014, Facebook, Inc.
3
* All rights reserved.
4
*
5
* This source code is licensed under the BSD-style license found in the
6
* LICENSE file in the root directory of this source tree. An additional grant
7
* of patent rights can be found in the PATENTS file in the same directory.
8
*
9
* @providesModule ReactDOM
10
* @typechecks static-only
11
*/
12
13
"use strict";
14
15
var ReactElement = require('ReactElement');
16
var ReactElementValidator = require('ReactElementValidator');
17
var ReactLegacyElement = require('ReactLegacyElement');
18
19
var mapObject = require('mapObject');
20
21
/**
22
* Create a factory that creates HTML tag elements.
23
*
24
* @param {string} tag Tag name (e.g. `div`).
25
* @private
26
*/
27
function createDOMFactory(tag) {
28
if (__DEV__) {
29
return ReactLegacyElement.markNonLegacyFactory(
30
ReactElementValidator.createFactory(tag)
31
);
32
}
33
return ReactLegacyElement.markNonLegacyFactory(
34
ReactElement.createFactory(tag)
35
);
36
}
37
38
/**
39
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
40
* This is also accessible via `React.DOM`.
41
*
42
* @public
43
*/
44
var ReactDOM = mapObject({
45
a: 'a',
46
abbr: 'abbr',
47
address: 'address',
48
area: 'area',
49
article: 'article',
50
aside: 'aside',
51
audio: 'audio',
52
b: 'b',
53
base: 'base',
54
bdi: 'bdi',
55
bdo: 'bdo',
56
big: 'big',
57
blockquote: 'blockquote',
58
body: 'body',
59
br: 'br',
60
button: 'button',
61
canvas: 'canvas',
62
caption: 'caption',
63
cite: 'cite',
64
code: 'code',
65
col: 'col',
66
colgroup: 'colgroup',
67
data: 'data',
68
datalist: 'datalist',
69
dd: 'dd',
70
del: 'del',
71
details: 'details',
72
dfn: 'dfn',
73
dialog: 'dialog',
74
div: 'div',
75
dl: 'dl',
76
dt: 'dt',
77
em: 'em',
78
embed: 'embed',
79
fieldset: 'fieldset',
80
figcaption: 'figcaption',
81
figure: 'figure',
82
footer: 'footer',
83
form: 'form',
84
h1: 'h1',
85
h2: 'h2',
86
h3: 'h3',
87
h4: 'h4',
88
h5: 'h5',
89
h6: 'h6',
90
head: 'head',
91
header: 'header',
92
hr: 'hr',
93
html: 'html',
94
i: 'i',
95
iframe: 'iframe',
96
img: 'img',
97
input: 'input',
98
ins: 'ins',
99
kbd: 'kbd',
100
keygen: 'keygen',
101
label: 'label',
102
legend: 'legend',
103
li: 'li',
104
link: 'link',
105
main: 'main',
106
map: 'map',
107
mark: 'mark',
108
menu: 'menu',
109
menuitem: 'menuitem',
110
meta: 'meta',
111
meter: 'meter',
112
nav: 'nav',
113
noscript: 'noscript',
114
object: 'object',
115
ol: 'ol',
116
optgroup: 'optgroup',
117
option: 'option',
118
output: 'output',
119
p: 'p',
120
param: 'param',
121
picture: 'picture',
122
pre: 'pre',
123
progress: 'progress',
124
q: 'q',
125
rp: 'rp',
126
rt: 'rt',
127
ruby: 'ruby',
128
s: 's',
129
samp: 'samp',
130
script: 'script',
131
section: 'section',
132
select: 'select',
133
small: 'small',
134
source: 'source',
135
span: 'span',
136
strong: 'strong',
137
style: 'style',
138
sub: 'sub',
139
summary: 'summary',
140
sup: 'sup',
141
table: 'table',
142
tbody: 'tbody',
143
td: 'td',
144
textarea: 'textarea',
145
tfoot: 'tfoot',
146
th: 'th',
147
thead: 'thead',
148
time: 'time',
149
title: 'title',
150
tr: 'tr',
151
track: 'track',
152
u: 'u',
153
ul: 'ul',
154
'var': 'var',
155
video: 'video',
156
wbr: 'wbr',
157
158
// SVG
159
circle: 'circle',
160
defs: 'defs',
161
ellipse: 'ellipse',
162
g: 'g',
163
line: 'line',
164
linearGradient: 'linearGradient',
165
mask: 'mask',
166
path: 'path',
167
pattern: 'pattern',
168
polygon: 'polygon',
169
polyline: 'polyline',
170
radialGradient: 'radialGradient',
171
rect: 'rect',
172
stop: 'stop',
173
svg: 'svg',
174
text: 'text',
175
tspan: 'tspan'
176
177
}, createDOMFactory);
178
179
module.exports = ReactDOM;
180
181