You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know there are other issues related to $Diff, but I wanted to lay out a particular use case that would eliminate a lot of the pain of using flow to type higher order functions and React components.
Current Scenario
Currently, flow forces you to manually diff objects, exemplified by the Translator HOC in the libdef for react-i18next:
I know there are other issues related to $Diff, but I wanted to lay out a particular use case that would eliminate a lot of the pain of using flow to type higher order functions and React components.
Current Scenario
Currently, flow forces you to manually diff objects, exemplified by the
Translator
HOC in the libdef for react-i18next:(this was in modeled after react-redux's Connector, which could probably also benefit from $Diff)
And it's usage:
Notice how you have to pass in props for the HOC and for the original component?
Ideal Scenario
Ideally, you could use $Diff to do that work for you:
Usage then becomes:
Non-React HOF
An example of where $Diff could be used to type generic higher order functions:
The text was updated successfully, but these errors were encountered: