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