'What do angular brackets in TypeScript with React's CreateContext mean?
Trying to follow https://medium.com/@thehappybug/using-react-context-in-a-typescript-app-c4ef7504c858 but the below confuses me. Is the AppContextInterface saying that's what the createContext expects as an argument or what it will return?
Example
const {Provider, Consumer} = React.createContext<AppContextInterface>();
Solution 1:[1]
"AppContextInterface" in your example is the type of the argument which will be passed to the createContext function i.e. what type should go in ().
Its called type assertion
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
