It’s not a bug, it’s a feature… The lesson is working properly; the problem is that type checking is not enforced in a React production build, which is the case for this particular lesson.
From the React documentation:
So, it will not work properly here.
This lesson should be taken as informative (to let you know the tool exists), but for production you should use something different, like TypeScript or Flow.