CONTEXT :
QUESTION :
Why am i not getting error's even when the return types are different ?
You don't get an error because one type is compatible with the other.
<Difficulties handleChange>
does NOT use the return value of the handler (it's claimed with the void
keyword), thus you can basically put there a handler which returns whatever you like, it's all acceptable and TS won't complain.