Tutorial: TabStack.getViews

TabStack.getViews

Returns an array of View Identities that belong to the stack.

Get the views for the current TabStack

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)`);