1

CODE TO REPRODUCE

import React from "react";
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { View, TouchableOpacity, Text } from "react-native";
// import EventScreen from "../screens/EventScreen";
import BottomTab from "./BottomTab";

import { WebView } from 'react-native-webview';

function EventScreen() {
    return (
        <View>
            <WebView
                source={{ uri: "google.com" }}
                style={{
                    marginTop: 20,
                    maxHeight: 500,
                    width: 320,
                    flex: 1,
                    opacity: 0.99
                }}
            />
        </View>)

}

function HomeScreen({ navigation }) {
    return (
        <View style={{ alignItems: "center", justifyContent: "center", flex: 1 }}>
            <TouchableOpacity onPress={() => navigation.navigate("Event")}>
                <Text style={{ color: "black" }}>EVENT</Text>
            </TouchableOpacity>
        </View>
    )
}

const Stack = createNativeStackNavigator();

export default function RootNavigator() {

    return (
        <Stack.Navigator
            initialRouteName="Home"
            screenOptions={{
                headerShown: false
            }}
        >
            <Stack.Screen
                name="Event"
                component={EventScreen}
                options={{
                    animationEnabled: false,
                }}
            />
            <Stack.Screen name="Home" >
                {(props) => <HomeScreen {...props} />}
            </Stack.Screen>
        </Stack.Navigator>
    )
}

The problem

When I navigate back from Event to Home on Android the entire app crashes.

The error is:

com.facebook.react.uimanager.IllegalViewOperationException: StackOverflowException

I tried to run this on the emulator and on a real phone

LOG

W/cr_AwContents: WebView.destroy() called while WebView is still attached to window.
E/chromium: [ERROR:aw_browser_terminator.cc(125)] Renderer process (2462) crash detected (code -1).
I/m.unifraternit: Background young concurrent copying GC freed 81145(2939KB) AllocSpace objects, 0(0B) LOS objects, 24% free, 8649KB/11MB, paused 10.148ms total 403.295ms
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c in tid 1913 (RenderThread), pid 1826 (m.unifraternity)
  • Does this answer your question? [React Native - Null pointer dereference after navigating to/from a page containing multiple tweets embedded inside their own WebViews](https://stackoverflow.com/questions/56553663/react-native-null-pointer-dereference-after-navigating-to-from-a-page-containi) – Ovidiu Cristescu Nov 25 '22 at 19:18

0 Answers0