# How to set root nav using getRootNavById

**URL:** <https://forum.ionicframework.com/t/how-to-set-root-nav-using-getrootnavbyid/115443>\
**Category:** ionic-v3\
**Created:** [December 15, 2017, 7:31am UTC](https://forum.ionicframework.com/t/how-to-set-root-nav-using-getrootnavbyid/115443 "2017-12-15T07:31:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![conceps](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/conceps/32/115624_2.png) [@conceps](https://forum.ionicframework.com/u/conceps)\
**Post date:** [December 15, 2017, 7:31am UTC](https://forum.ionicframework.com/t/how-to-set-root-nav-using-getrootnavbyid/115443/1 "2017-12-15T07:31:51Z")

</div>

(getRootNav) is deprecated and will be removed in the next major release. Use getRootNavById instead.

my current code is  
`this.app.getRootNav().setRoot(BootScreen);`

plesese tell me how to set root using getRootNavById

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [December 15, 2017, 9:10am UTC](https://forum.ionicframework.com/t/how-to-set-root-nav-using-getrootnavbyid/115443/2 "2017-12-15T09:10:43Z")

</div>

Some solutions were provided in this duplicate question

[https://forum.ionicframework.com/t/getrootnav-deprecated-use-getrootnavbyid-whats-the-value-of-the-root-nav-id?source\_topic\_id=115443](https://forum.ionicframework.com/t/getrootnav-deprecated-use-getrootnavbyid-whats-the-value-of-the-root-nav-id?source_topic_id=115443)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:59pm UTC](https://forum.ionicframework.com/t/how-to-set-root-nav-using-getrootnavbyid/115443/3 "2021-07-19T21:59:13Z")

</div>

Closed on July 19, 2021, 9:59pm UTC


