react-native-number-ticker
react-native-number-ticker copied to clipboard
Fix unique key issue when number has multiple of the same digit.
As reported here: https://github.com/RobertFOConnor/react-native-number-ticker/issues/1#issuecomment-654753430
Hi @RobertFOConnor. This is still an issue in the latest version when there are two same digits in the number prop. I recommend you amend the index of the
.map()
to the data as a key, to ensure it will always be unique.
return (number + '').split('').map((data, index) => {
<TextTicker
key={`${data}${index}`}
...
/>
})
See screenshot when value is
199