Pitfalls

Pitfalls to avoid when building userinterfaces with uikit

Asynchronous Objects inside Content

The Content component measures its content when the component is created. If the content is loaded asynchronous, this measurement will be incorrect. To prevent this behavior, suspense boundaries must be placed correctly.

❌ incorrect✅ correct
<Content>
    <Suspense>
        <Gltf src="...">
    </Suspense>
</Content>
<Suspense>
    <Content>
        <Gltf src="...">
    </Content>
</Suspense>

Non-Transparent Objects inside Content

To render objects in the correct order, we are using a custom transparent object sorter. Therefore, all objects inside uikit must either be transparent or must write to the depth buffer and should have a small offset in the z-axis towards its parent.