calblueprint / alemany

1 stars 0 forks source link

Adding a Tree | List Updating #97

Open sofiahowardjimenez opened 2 years ago

sofiahowardjimenez commented 2 years ago

After adding a tree, I don't think the list view automatically updated/fetched from the backend. I don't think the tree has shown up on the map either after pressing submit/going back to the map view.

sofiahowardjimenez commented 2 years ago

Yeah after trying to add tree the map and list does not reset, so I think you guys aren't refetching from the backend after each time it gets updated. Since you don't want to constantly be running your useEffect that fetches from the backend (because then you'd have like constant reads/writes) you want to make sure that each time the backend gets updated (something is added/deleted) you use another useEffect to reset the state variable that contains the data that you want displayed from the backend.

sofiahowardjimenez commented 2 years ago

Maybe this might actually being an issue, the real issue was not including an address and that those trees were being filtered out.