Closed mrjackdavis closed 3 years ago
@mrjackdavis Thank you for raising this. This is unlikely to be something we address in v4 of polished. We have a fair amount of type issues that we hope to address in v5 as part of our TS rewrite. Due to some quirks of flow and how we convert those to TS programmatically, we can't address these cases in the way we'd like. We will add this to our list of considerations for v5.
polished
version: 4.1.3JSS-in_CSS
library and version: N/AMixin/Helper/Shorthand Usage
What You Are Seeing
Response type of
getValueAndUnit
isany
What You Expected To See
Documentation suggests it resolves a tuple
I was going to propose a new change, but I found the return of the function quite unstable (e.g. it returned
[ initialValue, undefined ]
if there's no match.Below is an API which I find preferable, but it'd be considered a breaking change. So I've made an issue for advice from the maintainers on how to progress. (And I wrote it in TS, not sure how it would look in flow)
See the example in action
Reproduction