How do I prevent short undefined bursts on page load?

Hello, I have a city page that contains information about a city and then a bunch of other similar cities underneath which when clicked take you to a similar page with their info.

The page’s title is based on a database query from the cities table. And when you switch pages, the title shows undefined for a bit before showing the actual data.

This problem repeats itself across other components and pages in the app.

I’m curious what are some visual, or data fetching hacks that one can follow to prevent this from happening as I find it quite disruptive for the user experience flow.

You can either show some sort of a loading animation or just not load the content at all unless the collection is fetched. There are flags for that in the Collection object.

1 Like