File tree 4 files changed +34
-6
lines changed
4 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 1
1
// Chapter 01: Finding the correct types by navigating between type definitions
2
2
3
- const C01_Problem = ( ) => {
3
+ const C01_Navigation_Problem = ( ) => {
4
4
return (
5
5
< div
6
6
// type for aria-autocomplete ?
@@ -10,12 +10,12 @@ const C01_Problem = () => {
10
10
// type for onClick ?
11
11
onClick = { }
12
12
>
13
- C01_Problem
13
+ C01_Navigation_Problem
14
14
</ div >
15
15
)
16
16
}
17
17
18
- export default C01_Problem
18
+ export default C01_Navigation_Problem
19
19
20
20
// 💡 Tips: How to Navigate between type files ?
21
21
// Go to the type file and press F12 or Cmd + Click to navigate to the type file from the component file.
Original file line number Diff line number Diff line change 1
1
// Chapter 01: Finding the correct types by navigating between type definitions
2
2
3
- const C01_Solution = ( ) => {
3
+ const C01_Navigation_Solution = ( ) => {
4
4
return (
5
5
< div
6
6
// type for aria-autocomplete ?
@@ -12,12 +12,12 @@ const C01_Solution = () => {
12
12
console . log ( e )
13
13
} }
14
14
>
15
- C01_Solution
15
+ C01_Navigation_Solution
16
16
</ div >
17
17
)
18
18
}
19
19
20
- export default C01_Solution
20
+ export default C01_Navigation_Solution
21
21
22
22
// 💡 Tips: How to Navigate between type files ?
23
23
// Go to the type file and press F12 or Cmd + Click to navigate to the type file from the component file.
Original file line number Diff line number Diff line change
1
+ // Chapter 02: Add Proper Types to Props
2
+
3
+ const Child = ( props : Props ) => {
4
+ const { color } = props
5
+ return < div > { color } </ div >
6
+ }
7
+
8
+ const C02_Props_Problem = ( ) => {
9
+ return < Child color = "red" />
10
+ }
11
+
12
+ export default C02_Props_Problem
Original file line number Diff line number Diff line change
1
+ // Chapter 02: Add Proper Types to Props
2
+
3
+ type Props = {
4
+ color : string
5
+ }
6
+
7
+ const Child = ( props : Props ) => {
8
+ const { color } = props
9
+ return < div > { color } </ div >
10
+ }
11
+
12
+ const C02_Props_Solution = ( ) => {
13
+ return < Child color = "red" />
14
+ }
15
+
16
+ export default C02_Props_Solution
You can’t perform that action at this time.
0 commit comments