ion-range: Type 'string' is not assignable to type 'number'.
See original GitHub issueBug Report
There seems to be an issue with parsing numeric input to ion-range
component.
Ionic version: “@ionic/core”: “^4.0.0”
Current behavior:
[ ERROR ] TypeScript: src/components/predictors/uis/pepkalc/app-pepkalc.tsx:57:35
Type 'string' is not assignable to type 'number'.
L56: <ion-item>
L57: <ion-range pin min="0" max="400" color="primary">
L58: <ion-label slot="start">0K</ion-label>
Expected behavior: The range slider works and parses number arguments.
Steps to reproduce:
<ion-item>
<ion-range pin min="0" max="400" color="primary">
<ion-label slot="start">0K</ion-label>
<ion-label slot="end">400K</ion-label>
</ion-range>
</ion-item>
Because of the above the compilation process stops and reports an error.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
ion-range: Type 'string' is not assignable to type 'number'.
There seems to be an issue with parsing numeric input to ion-range component. Ionic version: "@ionic/core": "^4.0.0". Current behavior:.
Read more >Type 'string' is not assignable to type 'number' - Stack Overflow
toFixed returns a string which you are assigning to a variable which should be number . You need another pair of () to...
Read more >type 'string' is not assignable to type 'number'.ts
In this tutorial, we will see how to fix error type 'string' is not assignable to type 'number'.ts and also how to fix...
Read more >Type 'string' is not assignable to type 'any[]' - Ionic Forum
Hey everyone. One Problem and I don't know what to do :frowning: I had search a while but don't find solution: This is...
Read more >Error ts2322 type 'string' is not assignable to type 'number' In ...
Hello Friends,Today our topic is on error ts2322 type ' string' is not assignable to type ' number ' in typescript.Basically, this is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
🤦♂️ Thank you so much @brandyscarney . How embarrassing… All works like a charm now.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.