createLayoutGroup
Two primitives back the <LayoutGroup> component.
createLayoutGroup()
Reads the surrounding layout-group context and returns { forceRender }. Call forceRender() to
remeasure layout-animated descendants after DOM changes the projection tree would not otherwise
notice, such as route changes or third-party list reorders.
import { createLayoutGroup } from 'motion-solidjs'
import { onMount } from 'solid-js'
function GalleryShell() {
const { forceRender } = createLayoutGroup()
onMount(() => {
window.addEventListener('orientationchange', forceRender)
})
return <Gallery />
}
createLayoutGroupProvider(props)
The low-level provider half. It establishes a layout-group context for descendants and returns the
resolved { id, group, forceRender, key }. <LayoutGroup> wraps this internally; most apps should
use the component.
import { createLayoutGroupProvider } from 'motion-solidjs'
function CustomBoundary(props) {
createLayoutGroupProvider({ id: 'gallery', inherit: 'group' })
return <>{props.children}</>
}
π
Use these primitives when you need to compose groups manually or connect a non-component boundary, such as a route transition or portal, to the projection tree.