Skip to main content
.environment<K extends keyof EnvironmentValues>(key: K, value: EnvironmentValues[K]): Component;

Parameters

key
K extends keyof EnvironmentValues
The environment key to set. Must be a valid key from the EnvironmentValues interface.
value
EnvironmentValues[K]
The value to set for the specified environment key. The type is determined by the key.

Support

Usage

Set custom environment value

VStack([
    Text("Child component"),
    MyCustomComponent()
]).environment("myEnvironmentValue", true)