File size: 800 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
// Allow AMP elements to be a property on JSX.IntrinsicElements

// Only the intrinsic elements defined here will be accepted, and only with the attributes defined here
declare namespace JSX {
  interface AmpImg {
    alt?: string;
    src?: string;
    width?: string | number;
    height?: string | number;
    layout?: string;
    fallback?: string;
    children?: React.ReactNode;
  }
  interface IntrinsicElements {
    "amp-img": AmpImg;
  }
}

// Only the intrinsic elements defined here will be accepted, attributes don't matter
// declare namespace JSX {
//     interface IntrinsicElements {
//         'amp-img': any;
//     }
// }

// All intrinsic elements will be accepted
// declare namespace JSX {
//     interface IntrinsicElements {
//         [elemName: string]: any;
//     }
// }