adjust default value for createContext example - #67
Conversation
passing in `undefined` here throws the following error: ``` TS2345: Argument of type 'undefined' is not assignable to parameter of type 'App'. ``` I propose this type cast instead, even though not the most elegant solution, it avoids the error, as the context is already set in initialization of the React context.
|
I came across the same problem and would suggest another change here. |
|
If |
|
Yeah, those suggestions make sense as well, but then when actually using the Therefore with the code as currently here and the suggestions above, it would actually throw even two errors for me. |
passing in
undefinedhere throws the following error:I propose this type cast instead, even though not the most elegant solution, it avoids the error, as the context is already set in initialization of the React context.