Idiomatic way to dynamically create HTML select options
I have a form page that has only two HTML
On app load, I am using
I would like for the city
For populating the state
And for populating the city
I'm relatively new to Solid.js and was wondering what are the most idiomatic and performant ways to accomplish my goals.
select elements: one for states and another for cities.On app load, I am using
createResource(...) to make a fetch to my back end server to retrieve a nested list of states where each state has a list of cities.I would like for the city
select element to start off empty. The user must first select an option from the state select element. Then the city select element is dynamically populated with results from the createResource(...) call.For populating the state
select element, I thought about doing thisAnd for populating the city
select element, this is what I haveI'm relatively new to Solid.js and was wondering what are the most idiomatic and performant ways to accomplish my goals.
