10 examples of 'this router push' in JavaScript

Every line of 'this router push' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
19push(props, route) {
20 if(!props){
21 props = {};
22 }
23 route.props = props;
24 this.navigator.push(route);
25}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

28push(props, route) {
29 let routesList = this.navigator.getCurrentRoutes()
30 let nextIndex = routesList[routesList.length - 1].index + 1
31 route.props = props
32 route.index = nextIndex
33 this.navigator.push(route)
34}
51onPush(route: Route, props:{ [key: string]: any}):boolean {
52 this.refs.nav.push({...route, component:RouteIOS, passProps:{...props, route: route}});
53 return true;
54}
18push(component: any, params?: { [key: string]: any }, transition?: PageTransition) {
19 this.params = params;
20 this.navigationService.publish(component, this.host, transition);
21}
154private _push(
155 method: Method | MethodWildcard,
156 path: string,
157 handler: HandlerType,
158 options: RouteOptions
159) {
160 const keys: Keys = []
161 if (path === '*') {
162 path = '(.*)'
163 }
164 const regexp = pathToRegexp(path, keys, options)
165 this.routes.push({ method, path, handler, keys, options, regexp })
166 return this
167}
56export function push(routeName: string, params?: NavigationParams) {
57 if (navigationContainer && lastNavigateTime + 500 < Date.now()) {
58 navigationContainer.dispatch(
59 StackActions.push({
60 routeName,
61 params,
62 }),
63 );
64 lastNavigateTime = Date.now();
65 }
66}
27public push(): any {
28 return new Promise(function(resolve: Function): void {
29 resolve();
30 });
31}
135function push(self, type, url, group) {
136 if (!group) {
137 group = self.viewType === 'layout' ? 'layout' : 'default';
138 }
139
140 const item = {};
141 if (rAbs.test(url)) {
142 item.url = url;
143 } else {
144 item.route = RouteInfo.parse(self.route, url);
145 }
146
147 logger.debug('push %s, [%s] %s', type, group, url);
148
149 const bag = self.assets[group] ||
150 (self.assets[group] = { css: [], js: [] });
151 const list = bag[type];
152 list.push(item);
153}
40export function push({
41 routeName,
42 params,
43 action,
44}: {
45 routeName: string;
46 params?: object;
47 action?: never;
48}): StackActionType {
49 if (action !== undefined) {
50 throw new Error(
51 'Sub-actions are not supported for `push`. Remove the `action` key from the options.'
52 );
53 }
54
55 return StackActions.push(routeName, params);
56}
90removeRouter(router) {
91 this.routers.splice(this.routers.indexOf(router), 1);
92}

Related snippets