Skip to content

Commit 02fcb37

Browse files
committed
P/S
1 parent 952cc4e commit 02fcb37

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* 1. What is JSX.IntrinsicElements? CMD-click on .IntrinsicElements below
3+
* to go to its definition.
4+
*
5+
* Hint - remember to go to the original definition of JSX.IntrinsicElements
6+
* in @types/react/index.d.ts.
7+
*/
8+
9+
export type Example = JSX.IntrinsicElements;
10+
11+
/**
12+
* 2. What is the structure of JSX.IntrinsicElements? It appears to have the
13+
* HTML attributes as properties, but what are the values?
14+
*
15+
* 3. Let's have some fun. Edit the file to add a new property to
16+
* JSX.IntrinsicElements:
17+
*
18+
* interface IntrinsicElements {
19+
* // ...
20+
* myNewElement: {
21+
* foo: string;
22+
* }
23+
* }
24+
*
25+
* Notice that the error below goes away!
26+
*
27+
* 4. Now change it back, before anyone notices.
28+
*/
29+
30+
<myNewElement foo="123" />;

0 commit comments

Comments
 (0)