Skip to content

Commit 9403d1d

Browse files
docs: use native-stack in troubleshooting
1 parent 00d60f0 commit 9403d1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

versioned_docs/version-6.x/troubleshooting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,13 @@ code would be written as follows:
248248
249249
## I'm getting "Invalid hook call. Hooks can only be called inside of the body of a function component"
250250
251-
This can happen when you pass a React component to an option that accepts a function returning a react element. For example, the [`header` option in stack navigator](stack-navigator.md#header) expects a function returning a react element:
251+
This can happen when you pass a React component to an option that accepts a function returning a react element. For example, the [`headerCenter` option in native stack navigator](native-stack-navigator.md#headerCenter) expects a function returning a react element:
252252
253253
```js
254254
<Stack.Screen
255255
name="Home"
256256
component={Home}
257-
option={{ header: (props) => <MyHeader {...props} /> }}
257+
option={{ headerTitle: (props) => <MyTitle {...props} /> }}
258258
/>
259259
```
260260
@@ -266,7 +266,7 @@ If you directly pass a function here, you'll get this error when using hooks:
266266
component={Home}
267267
option={{
268268
// This is not correct
269-
header: MyHeader,
269+
headerTitle: MyTitle,
270270
}}
271271
/>
272272
```

0 commit comments

Comments
 (0)