You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import ActionSheet from "react-native-actions-sheet";
import { useEffect, useRef, memo } from "react";
import { Text, Button, View } from "react-native";
import type { ActionSheetRef } from "react-native-actions-sheet";
let renderCount = 0;
const Inner = memo(function () {
useEffect(() => {
renderCount++
}, []);
return (
<View style={{padding: 20}}>
<Text>{renderCount}</Text>
<Text>Hi, I am here.</Text>
<Text>Hi, I am here.</Text>
<Text>Hi, I am here.</Text>
<Text>Hi, I am here.</Text>
<Text>Hi, I am here.</Text>
</View>
);
});
export default function App() {
const actionSheetRef = useRef<ActionSheetRef>(null);
return (
<>
<Button title="show" onPress={() => actionSheetRef.current.show()} />
<ActionSheet ref={actionSheetRef}>
<Inner />
</ActionSheet>
</>
);
}
I want to render a webview within an ActionSheet, similar to the example provided. However, every time the inner component is recreated, it performs poorly in terms of performance.
The text was updated successfully, but these errors were encountered:
I want to render a webview within an ActionSheet, similar to the example provided. However, every time the inner component is recreated, it performs poorly in terms of performance.
The text was updated successfully, but these errors were encountered: