Skip to content

Commit c5508fa

Browse files
committed
Document headerShadowVisible
1 parent 3e8abe4 commit c5508fa

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

versioned_docs/version-6.x/elements.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,29 @@ Function which returns a React Element to display on the left side of the header
5353
/>
5454
),
5555
}}
56-
/>;
56+
/>
5757
```
5858

5959
#### `headerRight`
6060

6161
Function which returns a React Element to display on the right side of the header.
6262

63+
#### `headerShadowVisible`
64+
65+
Whether to hide the elevation shadow (Android) or the bottom border (iOS) on the header.
66+
67+
This is a short-hand for the following styles:
68+
69+
```js
70+
{
71+
elevation: 0,
72+
shadowOpacity: 0,
73+
borderBottomWidth: 0,
74+
}
75+
```
76+
77+
If the above styles are specified in `headerStyle` along with `headerShadowVisible: false`, then `headerShadowVisible: false` will take precedence.
78+
6379
#### `headerStyle`
6480

6581
Style object for the header. You can specify a custom background color here, for example.
@@ -209,9 +225,7 @@ A component which aids in improving performance for inactive screens by utilizin
209225
Usage:
210226

211227
```js
212-
<ResourceSavingView visible={0}>
213-
{/* Content */}
214-
</ResourceSavingView>
228+
<ResourceSavingView visible={0}>{/* Content */}</ResourceSavingView>
215229
```
216230

217231
## Utilities
@@ -223,9 +237,7 @@ A wrapper over the `SafeAreaProvider` component from [`react-native-safe-area-co
223237
Usage:
224238

225239
```js
226-
<SafeAreaProviderCompat>
227-
{/* Your components */}
228-
</SafeAreaProviderCompat>
240+
<SafeAreaProviderCompat>{/* Your components */}</SafeAreaProviderCompat>
229241
```
230242

231243
### `HeaderBackContext`
@@ -238,7 +250,7 @@ import { HeaderBackContext } from '@react-navigation/elements';
238250
// ...
239251

240252
<HeaderBackContext.Consumer>
241-
{headerBack => {
253+
{(headerBack) => {
242254
if (headerBack) {
243255
const backTitle = headerBack.title;
244256

@@ -247,7 +259,7 @@ import { HeaderBackContext } from '@react-navigation/elements';
247259

248260
/* render something */
249261
}}
250-
</HeaderBackContext.Consumer>
262+
</HeaderBackContext.Consumer>;
251263
```
252264

253265
### `HeaderShownContext`
@@ -260,10 +272,10 @@ import { HeaderShownContext } from '@react-navigation/elements';
260272
// ...
261273

262274
<HeaderShownContext.Consumer>
263-
{headerShown => {
275+
{(headerShown) => {
264276
/* render something */
265277
}}
266-
</HeaderShownContext.Consumer>
278+
</HeaderShownContext.Consumer>;
267279
```
268280

269281
### `HeaderHeightContext`
@@ -276,10 +288,10 @@ import { HeaderHeightContext } from '@react-navigation/elements';
276288
// ...
277289

278290
<HeaderHeightContext.Consumer>
279-
{headerHeight => {
291+
{(headerHeight) => {
280292
/* render something */
281293
}}
282-
</HeaderHeightContext.Consumer>
294+
</HeaderHeightContext.Consumer>;
283295
```
284296

285297
### `useHeaderHeight`

0 commit comments

Comments
 (0)