diff --git a/docs/docs/03-API/08-modifiers.md b/docs/docs/03-API/08-modifiers.md index 9bc9b1b1..d60690be 100644 --- a/docs/docs/03-API/08-modifiers.md +++ b/docs/docs/03-API/08-modifiers.md @@ -28,6 +28,7 @@ To approximate this in React Native, views are styled using props. Each prop cor | shadow | { color?: Color; x?: number; y?: number; radius: number; opacity?: number; } | | background | Color \| LinearGradient | | hidden | boolean | +| disabled | boolean | | frame | Frame | | zIndex | number | | opacity | number | diff --git a/ios/Common/View+Modifiers.swift b/ios/Common/View+Modifiers.swift index 881082ac..46790c7a 100644 --- a/ios/Common/View+Modifiers.swift +++ b/ios/Common/View+Modifiers.swift @@ -64,6 +64,11 @@ struct ReactNativeViewModifiers: ViewModifier { view = AnyView(view.tag(tag)) } + case "disabled": + if let disabled = value as? Bool { + view = AnyView(view.disabled(disabled)) + } + case "foregroundStyle": if let colorVal = value as? String { let color = getColor(colorVal) as Color? diff --git a/src/utils/modifiers/index.ts b/src/utils/modifiers/index.ts index e6d4835f..c9edd5ff 100644 --- a/src/utils/modifiers/index.ts +++ b/src/utils/modifiers/index.ts @@ -82,6 +82,7 @@ export type Modifiers = { opacity?: number; }; background?: Color | LinearGradient; + disabled?: boolean; hidden?: boolean; frame?: | {