covid19india / covid19india-react

Tracking the impact of COVID-19 in India
https://www.covid19india.org
MIT License
6.86k stars 3.41k forks source link

Fixes the weird placeholder strings appearing when language was changed #2510

Closed sbhrwlr closed 3 years ago

sbhrwlr commented 3 years ago

Fixes #2507

A brief description of what changes your PR introduces. The better this description, the quicker we can review, exchange feedback, and merge! After changing language the placeholder was displaying weird strings and not the cities suggestion you added it was happening because of useCallback function that starts running and do not terminate the priveous instance of useCallback I added language dependency to useCallback and function will terminate whenever the language state changes.

Fixes #2507

✔️ Compiles and passes lint tests ✔️ Properly formatted ✔️ Tested on desktop ✔️ Tested on phone

Before Fixing Screenshot :

initially Initially wrong strings

After Fixing Screenshots

now

nowtwo :

suryavirkapur commented 3 years ago

lgtm :)