title: ERROR TypeError: Cannot read property 'extras' of null
body: <p>this is my code and I am getting the error "ERROR TypeError: Cannot read property 'extras' of null "</p>
  
  <pre><code>  ngOnInit() {
    const navigation = this.router.getCurrentNavigation();
    const state = navigation.extras.state as {
    api: string;
    trace_id: string;
    token_id: string;
    hotel_code: string;
    result_index: string;
    };
    this.reqObj = {
    api: state.api,
    trace_id: state.trace_id,
    token_id: state.token_id,
    hotel_code: state.hotel_code,
    result_index: state.result_index
      };
    }
  </code></pre>