[solved] Brain fart: in need of fresh eyes
I just can't seem to access the results outside of the function in my returned jsx. Hoping to loop and create
<option value={item.id}>{item.name}</option>
Thank you in advance.10 Replies
this works just fine, and I can't see the difference between
getData
and fetchZones
.
Going to lunch.
<ugh>allTimeZones()
Not allTimeZones
Also it should be a map not a foreach
down in the returned jsx -- tried that and it never Shows
Thought I tried the map. I'll go back. thanks.
map((item) => <option...) or map((item) => { return <option...})
with the
()
the show never fires. When I take the ()
away, then it "Shows" but then get error in console allTimeZones() is undefined
-- which makes sense if the <Show
fires right away rather than waiting for the <Show when={allTimeZones()}>
accutually should "show" --- I'm going in circles.
Thanks for looking, I'm just going to delete and start over.What about allTimeZones()?.allzones
In the show
Sorry in the map call
allTimeZones()?.allzones.data.map
I did not realize but your map in that screenshot will not work because it isn't returning anything.
I just can't seem to get the data outside of the
fetchZones
arrow function. So, however incorrect the JSX may be, I'm not making it available outside the arrow function. Deleting...if you console log allTimeZones in a createEffect what does it output?
Thanks for helping me think through the issue. It was something not getting it out of the function correct, thus the JSX wasn't the issue. Now, I'm not exactly sure which is the correct way, but I'm not touching this damn thing (for a bit anyway).