touchableOpacity

External Documentation

RNTouchableOpacityElement touchableOpacity({

  1. void onPress()?,
  2. Map<String, dynamic>? style,
  3. Map<String, dynamic>? props,
  4. List<ReactElement>? children,
  5. JSAny? child,
})

TouchableOpacity component

Implementation

RNTouchableOpacityElement touchableOpacity({
  void Function()? onPress,
  Map<String, dynamic>? style,
  Map<String, dynamic>? props,
  List<ReactElement>? children,
  JSAny? child,
}) {
  final p = <String, dynamic>{};
  if (onPress != null) p['onPress'] = onPress;
  if (style != null) p['style'] = style;
  if (props != null) p.addAll(props);
  return RNTouchableOpacityElement.fromJS(
    rnElement('TouchableOpacity', props: p, children: children, child: child),
  );
}