@@ -22,21 +22,32 @@ const Page = () => (
22
22
< Example />
23
23
< hr />
24
24
< Exercise />
25
- < h3 > Bonus Exercise</ h3 >
26
- < p >
27
- < input type = "checkbox" />
28
- b.1. In{ " " }
29
- < code >
30
- src/components/patterns/Context/exercise/GraphQLProvider.jsx
31
- </ code > { " " }
32
- we are using < code > const memoizedHashGql = memoize(hashGql);</ code > .
33
- Should we use useMemo instead? Why?
34
- </ p >
25
+
26
+ < h3 > Bonus Exercise 1</ h3 >
27
+ < p > Now that you know how the React Context works:</ p >
28
+ < ul >
29
+ < li >
30
+ < input type = "checkbox" /> Would use the React Context for the form in
31
+ the previous React Reducer Exercise? What are the pros and cons?
32
+ </ li >
33
+ < li >
34
+ < input type = "checkbox" /> If you use the Context for the form, would you
35
+ pass the value of the field and other props to the Field component using
36
+ context or props?
37
+ </ li >
38
+ < li >
39
+ < input type = "checkbox" /> If you pass the value of the "input" and the
40
+ other required props to the Field component using context, does it still
41
+ make sense to use the React.memo HoC in the Field component?
42
+ </ li >
43
+ </ ul >
44
+
45
+ < h3 > Bonus Exercise 2</ h3 >
35
46
< p >
36
- < input type = "checkbox" />
37
- b.2. In our current implementation, although there is a cache (data key in
38
- our reducer) for each pair query & variables , we can only send 1 query at
39
- a time . How would you make it possible to send requests concurrently ?
47
+ < input type = "checkbox" /> In our current implementation, although there is
48
+ a cache (data key in our reducer) for each pair query & variables , we can
49
+ only send 1 query at a time . How would you make it possible to send
50
+ requests concurrently ?
40
51
</ p >
41
52
</ React . Fragment >
42
53
) ;
0 commit comments