Skip to main content

Function: FilamentScene()

FilamentScene(__namedParameters): null | Element

The <FilamentScene> holds contextual values for a Filament rendering scene.

You need to wrap your rendering scene (= a component that uses <FilamentView>, hooks or other Filament components) with a <FilamentScene>.

Parameters

__namedParameters: FilamentProviderProps

Returns

null | Element

Note

Make sure to wrap your scene in a parent component, otherwise the React context cannot be inferred.

Example

function Scene() {
// in here you can use Filament's hooks and components
return (
<FilamentView style={styles.container}>
<DefaultLight />
<Model source={{ uri: modelPath }} />
</FilamentView>
)
}

export function RocketModel() {
// in here you only need to wrap the child-component with <FilamentScene>
return (
<FilamentScene>
<Scene />
</FilamentScene>
)
}

Defined in

src/react/FilamentScene.tsx:48