MCPcopy Create free account
hub / github.com/callstack/react-native-paper / renderSurface

Function renderSurface

example/src/Examples/SurfaceExample.tsx:20–36  ·  view source on GitHub ↗
(index: number, mode: 'flat' | 'elevated')

Source from the content-addressed store, hash-verified

18 const elevationValues = isV3 ? Array.from({ length: 6 }) : v2Elevation;
19
20 const renderSurface = (index: number, mode: 'flat' | 'elevated') => (
21 <Surface
22 key={index}
23 style={[
24 styles.surface,
25 isV3 ? styles.v3Surface : { elevation: v2Elevation[index] },
26 ]}
27 mode={mode}
28 {...(isV3 && { elevation: index as MD3Elevation })}
29 >
30 <Text variant="bodyLarge">
31 {isV3
32 ? `Elevation ${index === 1 ? '(default)' : ''} ${index}`
33 : `${elevationValues[index]}`}
34 </Text>
35 </Surface>
36 );
37
38 return (
39 <ScreenWrapper>

Callers 1

SurfaceExampleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…