one
Version:
One is a new React Framework that makes Vite serve both native and web.
17 lines (16 loc) • 619 B
JavaScript
import { StackRouter } from "@react-navigation/native";
const CustomStackRouter = (options) => {
const router = StackRouter(options), og = router.getStateForAction.bind(router);
return router.getStateForAction = (state, action, options2) => {
const next = og(state, action, options2);
if (action.type === "NAVIGATE" && next?.routes) {
const outRoutes = next.routes, firstRoute = outRoutes[0];
firstRoute.name.includes("[...") && outRoutes.every((x) => x.name === firstRoute.name);
}
return next;
}, router;
};
export {
CustomStackRouter
};
//# sourceMappingURL=OneStackRouter.js.map