Tutorial: View.getCurrentStack

View.getCurrentStack

Returns the TabStack instance the view belongs to.

Get the tabstack for the current view

if (!fin.me.isView) {
    throw new Error('Not running in a platform View.');
}

const stack = await fin.me.getCurrentStack();
// Alternatively, you can wrap any view and get the stack from there
// const viewFromSomewhere = fin.View.wrapSync(someView.identity);
// const stack = await viewFromSomewhere.getCurrentStack();
const views = await stack.getViews();
console.log(`Stack contains ${views.length} view(s)`);