Hopefully someone can point me in the right direction to the cleanest/most accepted way of storing HTML markup in React apps.
Imagine my scenario: I have a country dropdown menu (<select>
). When you select a country from the menu, a "State/Province" <select>
becomes visible. Based on the country you picked, a React.Fragment is inserted into the new "State/Province" <select>
field giving you options for the country you've selected.
Everything works fine; problem is I have three very large React.Fragments as variables/members in my component class above all my methods. One of them looks like this.
canadaStateProvinceOptions = (
<React.Fragment>
<option value="">--Choose One--</option>
<option value="AB">Alberta</option>
<option value="BC">British Columbia</option>
<option value="CD">Canada (Province unknown)</option>
<option value="MB">Manitoba</option>
<option value="XN">Nunavut Providence</option>
<option value="NF">Newfoundland (Includes Labrador)</option>
<option value="NK">New Brunswick</option>
<option value="NS">Nova Scotia</option>
<option value="NT">Northwest Territories (Canadian Admin. Division)</option>
<option value="ON">Ontario</option>
<option value="PE">Prince Edward Island</option>
<option value="PQ">Quebec</option>
<option value="SN">Saskatchewan</option>
<option value="YT">Yukon (Canadian Territory)</option>
</React.Fragment>
);
There are two more which have way more options.. Should I be keeping these as class members of my component or is there a better way to separate this concern?