question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.1.0] WizardComponent.navigation undefined

See original GitHub issue

I’m trying to use goToStep in code and have followed previous suggestions but the navigation property seems to be undefined. Let me know what other information I can provide to help.

Aside: Trying to jump to a specific step from a remote page. Is there a good way to use routing with wizard steps? The below example code gives console error: ERROR TypeError: Cannot read property 'goToStep' of undefined

import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

import { WizardComponent } from 'ng2-archwizard';

@Component({
  selector: 'app-my-custom-wizard',
  templateUrl: './my-custom-wizard.component.html',
  styleUrls: ['./my-custom-wizard.component.css']
})
export class MyCustomWizardComponent implements OnInit {
  @ViewChild(WizardComponent)
  public wizard: WizardComponent;

  constructor(private route: ActivatedRoute) {
  }

  ngOnInit() {
    this.route
      .queryParams
      .subscribe((params) => this.wizard.navigation.goToStep(+params.step));
  }

}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JoseChip28commented, Jan 30, 2019

I’m trying to use goToNextStep in code

ERROR TypeError: Cannot read property 'navigation' of undefined
    at SolicitudComponent.push../ControlFisApp/app/components/solicitud/solicitud.component.ts.SolicitudComponent.cambiarPaso (solicitud.component.ts:451)
    at SafeSubscriber._next (solicitud.component.ts:408)
    at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:196)
    at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:134)
    at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77)
    at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
    at MapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next (map.js:41)
    at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
    at FilterSubscriber.push../node_modules/rxjs/_esm5/internal/operators/filter.js.FilterSubscriber._next (filter.js:38)
    at FilterSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
0reactions
roydekleijncommented, Jul 18, 2021

nope doesn’t work with version 7.0.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native/navigation error displaying component ...
React native/navigation error displaying component/component is undefined · First I got an error saying Text strings must be rendered within a < ...
Read more >
undefined is not an object evaluating navigation.navigate
<TouchableHighlight onPress={() => navigation.navigate('DrawerOpen')}>. On mainScreen , you are fine because it's not a pure component with ...
Read more >
Access the navigation prop from any component
It's useful when you cannot pass the navigation prop into the component directly ... throw an 'undefined is not a function' exception because...
Read more >
React Native: undefined is not a function(evaluating '(0 ...
React Native changes so often and some parts that we take for granted suddenly changes. So if you have an old version of...
Read more >
Track the Current Route in React Navigation V5 Outside Of a ...
React Navigation 5.x has useful hooks that are great when you don't want to pass ... Routes | undefined => { if (state.index...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found