nativescript-vue / nativescript-vue-navigator

A simple router for NativeScript-Vue, built on top of $navigateTo to simplify routing from within components
MIT License
98 stars 10 forks source link

$navigateTo() frame ID issue #55

Open unremarkablegarden opened 4 years ago

unremarkablegarden commented 4 years ago

To use this.$navigateTo() you now have to specify the frame ID 'navigator' explicitly or it won't navigate. Also won't give an error unless you add a catch().

This after running some of the later updates to the nativescript vue packages. Not sure which version I was at before when it was still working, sorry. Currently on the latest.

this.$navigateTo(ItemDetails, {
    frame: 'navigator',
    props: { ... }
}).catch(error => console.log(error))

The error I caught was: TypeError: undefined is not an object (evaluating 'frame.id')

rigor789 commented 4 years ago

That's correct - you shouldn't need to use $navigateTo with the navigator, the call should be

this.$navigator.navigate('/path/of/the/details/route', {
    props: { ... }
}).catch(error => console.log(error))