MCPcopy
hub / github.com/callstack/react-native-pager-view / childrenWithOverriddenStyle

Function childrenWithOverriddenStyle

src/utils.tsx:4–19  ·  view source on GitHub ↗
(
  children?: ReactNode,
  _pageMargin = 0
)

Source from the content-addressed store, hash-verified

2import { StyleSheet, View } from 'react-native';
3
4export const childrenWithOverriddenStyle = (
5 children?: ReactNode,
6 _pageMargin = 0
7) => {
8 return Children.map(children, (child) => {
9 const element = child as React.ReactElement<any>;
10 return (
11 <View style={StyleSheet.absoluteFill} collapsable={false}>
12 {React.cloneElement(element, {
13 ...element.props,
14 style: [element.props.style, StyleSheet.absoluteFill],
15 })}
16 </View>
17 );
18 });
19};

Callers 1

renderMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…