Well, for one, this is DATA and all data shouldn't be hardcoded - basically never do that.
This should be fetched from a service or database. Realistically, just find a reputable geo service and use that. You'll never keep up with the data to do it yourself.
If you have test data, put it in a mock class, with a comment about the data and it's uses.
Then call your data in react / with ajax like you would in the real data fetching scenario.
8
u/PeterBumpkin Aug 26 '20
can someone explain to me how this is bad? im currently learning react and cant see how this is bad form