Compile using strictFunctionTypes: true
Describe the feature that you would like added
Office-ui-fabric-react should compile with the typescript option strictFunctionTypes set to true. This would add additional type safety and help prevent potential issues with functions.
Issues requesting fix/examples of friction:
#9581 #10046
What component or utility would this be added to
Enable strictFunctionTypes in the ts compiler options
adding some relevant folks to discussion
I personally think that this can't hurt to add, if no one has objections I'll explore how much work it would be to enable it.
The question is should we fix some typings that lead to incompatibility with strictFunctionTypes such as IRenderFunction? And if that's the case, would it best be done leading into a major release? At least those were the questions I had when investigating this.
This came up over the List examples which use onRenderCell functions that are inconsistent with List's type and generate a type error when using strictFunctionTypes.
We're planning on upgrading to TS3.7 soon and could investigate enabling strictFunctionTypes. However, to Kevin's point, it may not be possible to enable this without interface breaks. In that case, I think it's important to transition to using strictFunctionTypes for our next major release since it helps identify these types of inconsistencies.
Agreed, I think the strictFunctionTypes transition would be better done in a major release instead of with the TS 3.7 upgrade--both due to the potential for breaks and the extra work involved.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.