Skip to content

Commit

Permalink
chore: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lodev09 committed Apr 8, 2024
1 parent 233da27 commit 5a52e71
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,24 @@ If you pass a functional `Component` to the `FooterComponent` prop, it may cause
Alaternatively, you can wrap the component using the [`useCallback`](https://react.dev/reference/react/useCallback) hook.
Example:
```ts
// Bad ❌
<TrueSheet FooterComponent={() => <View />}>
// ...
</TrueSheet>
```
```ts
// Good ✅
const MyFooter = useCallback(() => <View />, [])
<TrueSheet FooterComponent={MyFooter}>
// ...
</TrueSheet>
return (
<TrueSheet FooterComponent={MyFooter}>
// ...
</TrueSheet>
)
```
```ts
// Better ✅
<TrueSheet FooterComponent={<View />}>
// ...
Expand Down

0 comments on commit 5a52e71

Please sign in to comment.