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 cd45a9d commit 09f06d3
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,35 +235,9 @@ return (
)
```
### `FooterComponent` weird layout
### Weird layout render
If you pass a functional `Component` to the `FooterComponent` prop, it may cause unexpected issues during layout changes. Consider passing a `ReactElement` instead!
Alaternatively, you can wrap the component using the [`useCallback`](https://react.dev/reference/react/useCallback) hook.
```ts
// Bad ❌
<TrueSheet FooterComponent={() => <View />}>
// ...
</TrueSheet>
```
```ts
// Good ✅
const MyFooter = useCallback(() => <View />, [])
return (
<TrueSheet FooterComponent={MyFooter}>
// ...
</TrueSheet>
)
```
```ts
// Better ✅
<TrueSheet FooterComponent={<View />}>
// ...
</TrueSheet>
````
The sheet does not have control over how React Native renders components and may lead to rendering issues. To resolve this, try to minimize the use of `flex=1` in your content styles. Instead, use fixed `height` or employ `flexGrow`, `flexBasis`, etc., to manage your layout requirements.
## v1 Roadmap
Expand Down

0 comments on commit 09f06d3

Please sign in to comment.