Modifiers
createModifier
Factory function to create modifier configuration objects. This is used by all built-in modifier functions and can be used by 3rd party libraries to create custom modifiers.
createModifier(type, params)
| Parameter | Type | Description |
|---|---|---|
type | string | The modifier type string that maps to a registered native modifier. |
params(optional) | Record<string, any> | Additional parameters to pass to the modifier. Default: {} |
Factory function to create modifier configuration objects. This is used by all built-in modifier functions and can be used by 3rd party libraries to create custom modifiers.
Returns: ModifierConfig
A ModifierConfig object that can be passed in the modifiers prop array.
Example
// In a 3rd party package
import { createModifier } from '@expo/ui/swift-ui/modifiers';
export const blurEffect = (params: { radius: number; style?: string }) =>
createModifier('blurEffect', params);Works with
This is not a modifier. It is a function that makes the config for a custom native modifier.
Sources
The original Expo docs for this page:
- createModifier (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)