Appending to React's Global Namespace
It's possible to change a global namespace in TypeScript by using declare global
.
Here were are set up to modify the React
namespace:
declare global { namespace React {}}
Challenge
We currently have a failing test:
type test = Expect<Equal<React.MyInter
Transcript
00:00 It's actually possible to change things in the global namespace in TypeScript. Here we have a declare global, which is where some namespace react lives. And what we want to do here is we just want to add in a my interface interface. And that's just going to sit there and it's going to have foo string on it.
00:17 And that's all I want you to do is just want you to try and figure this out really. And we'll see later how this is so powerful and why you can do interesting things with it. But for now, that's all I want you to do. Good luck.