if (route?.name) {
routeNames.push(route.name);
}
} else {
route = state.routes[state.index];
routeNames.push(
...Object.keys(screens).filter((name) => route?.name === name)
);
}
An unexpected error has appeared in a file I did not modify during the creation of my React Native application, leading to confusion.