I'm developing an application with Angular.
I have created a page component that consists of several subcomponents. I set up each subcomponent to get data via an api call in ngOnInit and then update the screen to match the data.
The problem is that the layout shift is exposed to the user. Different components take different amounts of time to make the API calls, the data written to the component is not of a fixed length, so the height of the components is not fixed, resulting in a large layout shift, which is visible to the user in the process. (After rendering component A, the position of B and C changes)
I tried to fix this by using ngAfterViewInit or other angular lifecycle methods, but even if I adjust the template rendering with ngIf, hidden, etc, the layout change is still visible to the user.
The only way I've found is to use setTimeout to hide the screen for the duration of the layout change.
However, this seems like a bad idea. Is there any good way to solve this problem except applying skeleton UI, using setTimeout, and emitting events?
This is an example created with the same configuration as my project. You can see the rendering process for each list in their project as well. (Exposing the process of updating templates on the Defaults screen)
I really want to get this fixed. Any advice would be greatly appreciated