@@ -274,24 +274,24 @@ declare type $JSXIntrinsics = {
274
274
a : { instance : HTMLAnchorElement , props : ReactDOM$HTMLElementProps } ,
275
275
abbr : ReactDOM$HTMLElementJSXIntrinsic ,
276
276
address : ReactDOM$HTMLElementJSXIntrinsic ,
277
- area : ReactDOM$HTMLElementJSXIntrinsic ,
277
+ area : { instance : HTMLElement , props : ReactDOM$VoidElementProps < ReactDOM$HTMLElementProps > } ,
278
278
article : ReactDOM$HTMLElementJSXIntrinsic ,
279
279
aside : ReactDOM$HTMLElementJSXIntrinsic ,
280
280
audio : { instance : HTMLAudioElement , props : ReactDOM$HTMLElementProps } ,
281
281
b : ReactDOM$HTMLElementJSXIntrinsic ,
282
- base : ReactDOM$HTMLElementJSXIntrinsic ,
282
+ base : { instance : HTMLElement , props : ReactDOM$VoidElementProps < ReactDOM$HTMLElementProps > } ,
283
283
bdi : ReactDOM$HTMLElementJSXIntrinsic ,
284
284
bdo : ReactDOM$HTMLElementJSXIntrinsic ,
285
285
big : ReactDOM$HTMLElementJSXIntrinsic ,
286
286
blockquote : ReactDOM$HTMLElementJSXIntrinsic ,
287
287
body : ReactDOM$HTMLElementJSXIntrinsic ,
288
- br : { instance : HTMLBRElement , props : ReactDOM$HTMLElementProps } ,
288
+ br : { instance : HTMLBRElement , props : ReactDOM$VoidElementProps < ReactDOM$ HTMLElementProps> } ,
289
289
button : { instance : HTMLButtonElement , props : ReactDOM$HTMLElementProps } ,
290
290
canvas : { instance : HTMLCanvasElement , props : ReactDOM$HTMLElementProps } ,
291
291
caption : { instance : HTMLTableCaptionElement , props : ReactDOM$HTMLElementProps } ,
292
292
cite : ReactDOM$HTMLElementJSXIntrinsic ,
293
293
code : ReactDOM$HTMLElementJSXIntrinsic ,
294
- col : ReactDOM$HTMLElementJSXIntrinsic ,
294
+ col : { instance : HTMLElement , props : ReactDOM$VoidElementProps < ReactDOM$HTMLElementProps > } ,
295
295
colgroup : ReactDOM$HTMLElementJSXIntrinsic ,
296
296
data : ReactDOM$HTMLElementJSXIntrinsic ,
297
297
datalist : ReactDOM$HTMLElementJSXIntrinsic ,
@@ -304,7 +304,7 @@ declare type $JSXIntrinsics = {
304
304
dl : { instance : HTMLDListElement , props : ReactDOM$HTMLElementProps } ,
305
305
dt : ReactDOM$HTMLElementJSXIntrinsic ,
306
306
em : ReactDOM$HTMLElementJSXIntrinsic ,
307
- embed : ReactDOM$HTMLElementJSXIntrinsic ,
307
+ embed : { instance : HTMLElement , props : ReactDOM$VoidElementProps < ReactDOM$HTMLElementProps > } ,
308
308
fieldset : { instance : HTMLFieldSetElement , props : ReactDOM$HTMLElementProps } ,
309
309
figcaption : ReactDOM$HTMLElementJSXIntrinsic ,
310
310
figure : ReactDOM$HTMLElementJSXIntrinsic ,
@@ -319,24 +319,24 @@ declare type $JSXIntrinsics = {
319
319
head : ReactDOM$HTMLElementJSXIntrinsic ,
320
320
header : ReactDOM$HTMLElementJSXIntrinsic ,
321
321
hgroup : ReactDOM$HTMLElementJSXIntrinsic ,
322
- hr : { instance : HTMLHRElement , props : ReactDOM$HTMLElementProps } ,
322
+ hr : { instance : HTMLHRElement , props : ReactDOM$VoidElementProps < ReactDOM$ HTMLElementProps> } ,
323
323
html : ReactDOM$HTMLElementJSXIntrinsic ,
324
324
i : ReactDOM$HTMLElementJSXIntrinsic ,
325
325
iframe : { instance : HTMLIFrameElement , props : ReactDOM$HTMLElementProps } ,
326
- img : { instance : HTMLImageElement , props : ReactDOM$HTMLElementProps } ,
326
+ img : { instance : HTMLImageElement , props : ReactDOM$VoidElementProps < ReactDOM$ HTMLElementProps> } ,
327
327
ins : ReactDOM$HTMLElementJSXIntrinsic ,
328
328
kbd : ReactDOM$HTMLElementJSXIntrinsic ,
329
- keygen : ReactDOM$HTMLElementJSXIntrinsic ,
329
+ keygen : { instance : HTMLElement , props : ReactDOM$VoidElementProps < ReactDOM$HTMLElementProps > } ,
330
330
label : { instance : HTMLLabelElement , props : ReactDOM$HTMLElementProps } ,
331
331
legend : { instance : HTMLLegendElement , props : ReactDOM$HTMLElementProps } ,
332
332
li : { instance : HTMLLIElement , props : ReactDOM$HTMLElementProps } ,
333
- link : { instance : HTMLLinkElement , props : ReactDOM$HTMLElementProps } ,
333
+ link : { instance : HTMLLinkElement , props : ReactDOM$VoidElementProps < ReactDOM$ HTMLElementProps> } ,
334
334
main : ReactDOM$HTMLElementJSXIntrinsic ,
335
335
map : ReactDOM$HTMLElementJSXIntrinsic ,
336
336
mark : ReactDOM$HTMLElementJSXIntrinsic ,
337
337
menu : ReactDOM$HTMLElementJSXIntrinsic ,
338
- menuitem : ReactDOM$HTMLElementJSXIntrinsic ,
339
- meta : { instance : HTMLMetaElement , props : ReactDOM$HTMLElementProps } ,
338
+ menuitem : { instance : HTMLElement , props : ReactDOM$VoidElementProps < ReactDOM$HTMLElementProps > } ,
339
+ meta : { instance : HTMLMetaElement , props : ReactDOM$VoidElementProps < ReactDOM$ HTMLElementProps> } ,
340
340
meter : ReactDOM$HTMLElementJSXIntrinsic ,
341
341
nav : ReactDOM$HTMLElementJSXIntrinsic ,
342
342
noscript : ReactDOM$HTMLElementJSXIntrinsic ,
@@ -346,7 +346,7 @@ declare type $JSXIntrinsics = {
346
346
option : { instance : HTMLOptionElement , props : ReactDOM$HTMLElementProps } ,
347
347
output : ReactDOM$HTMLElementJSXIntrinsic ,
348
348
p : { instance : HTMLParagraphElement , props : ReactDOM$HTMLElementProps } ,
349
- param : ReactDOM$HTMLElementJSXIntrinsic ,
349
+ param : { instance : HTMLElement , props : ReactDOM$VoidElementProps < ReactDOM$HTMLElementProps > } ,
350
350
picture : ReactDOM$HTMLElementJSXIntrinsic ,
351
351
pre : { instance : HTMLPreElement , props : ReactDOM$HTMLElementProps } ,
352
352
progress : ReactDOM$HTMLElementJSXIntrinsic ,
@@ -359,7 +359,7 @@ declare type $JSXIntrinsics = {
359
359
script : { instance : HTMLScriptElement , props : ReactDOM$HTMLElementProps } ,
360
360
section : ReactDOM$HTMLElementJSXIntrinsic ,
361
361
small : ReactDOM$HTMLElementJSXIntrinsic ,
362
- source : { instance : HTMLSourceElement , props : ReactDOM$HTMLElementProps } ,
362
+ source : { instance : HTMLSourceElement , props : ReactDOM$VoidElementProps < ReactDOM$ HTMLElementProps> } ,
363
363
span : { instance : HTMLSpanElement , props : ReactDOM$HTMLElementProps } ,
364
364
strong : ReactDOM$HTMLElementJSXIntrinsic ,
365
365
style : { instance : HTMLStyleElement , props : ReactDOM$HTMLElementProps } ,
@@ -375,12 +375,12 @@ declare type $JSXIntrinsics = {
375
375
time : ReactDOM$HTMLElementJSXIntrinsic ,
376
376
title : ReactDOM$HTMLElementJSXIntrinsic ,
377
377
tr : { instance : HTMLTableRowElement , props : ReactDOM$HTMLElementProps } ,
378
- track : ReactDOM$HTMLElementJSXIntrinsic ,
378
+ track : { instance : HTMLElement , props : ReactDOM$VoidElementProps < ReactDOM$HTMLElementProps > } ,
379
379
u : ReactDOM$HTMLElementJSXIntrinsic ,
380
380
ul : { instance : HTMLUListElement , props : ReactDOM$HTMLElementProps } ,
381
381
'var' : ReactDOM$HTMLElementJSXIntrinsic ,
382
382
video : { instance : HTMLVideoElement , props : ReactDOM$HTMLElementProps } ,
383
- wbr : ReactDOM$HTMLElementJSXIntrinsic ,
383
+ wbr : { instance : HTMLElement , props : ReactDOM$VoidElementProps < ReactDOM$HTMLElementProps > } ,
384
384
// SVG
385
385
svg : ReactDOM$SVGElementJSXIntrinsic ,
386
386
animate : ReactDOM$SVGElementJSXIntrinsic ,
@@ -404,7 +404,7 @@ declare type $JSXIntrinsics = {
404
404
tspan : ReactDOM$SVGElementJSXIntrinsic ,
405
405
use : ReactDOM$SVGElementJSXIntrinsic ,
406
406
// Elements React adds extra props for.
407
- input : { instance : HTMLInputElement , props : ReactDOM$HTMLElementProps } ,
407
+ input : { instance : HTMLInputElement , props : ReactDOM$VoidElementProps < ReactDOM$ HTMLElementProps> } ,
408
408
textarea : { instance : HTMLTextAreaElement , props : ReactDOM$HTMLElementProps } ,
409
409
select : { instance : HTMLSelectElement , props : ReactDOM$HTMLElementProps } ,
410
410
// Catch-all for custom elements.
@@ -505,4 +505,19 @@ type ReactDOM$Style = Object; // TODO
505
505
506
506
// NOTE: In principle this can be `number | string`, but constraining values to
507
507
// numbers might be a useful design choice.
508
- type ReactDOM$Number = number;
508
+ type ReactDOM$Number = number;
509
+
510
+ // Changes children and dangerouslySetInnerHTML in a given props type to be
511
+ // optional (if they're not already) and limits them to empty values.
512
+ // This helps model the React dev mode warning emitted when setting either of
513
+ // these props on an empty HTML element.
514
+ type ReactDOM$VoidElementProps< Props > = $Diff<
515
+ Props ,
516
+ {
517
+ children : any ,
518
+ dangerouslySetInnerHTML : any
519
+ }
520
+ > & {
521
+ children ?: ?void , // Empty elements cannot have children
522
+ dangerouslySetInnerHTML ?: ?void // innerHTML cannot be set on empty elements
523
+ } ;
0 commit comments