2.0.0-beta • Published 4 years ago

universal-getcurrentpages v2.0.0-beta

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
4 years ago

group: title: Application

title: getCurrentPages

getCurrentPages

npm npm

Gets the current page stack. In the array, the first element is the homepage and the last element is the current page.

Support

Install

$ npm install universal-getcurrentpages --save

Usage

import { createElement, useEffect, Fragment } from 'rax';
import getCurrentPages from 'universal-getcurrentpages';

function App() {
  useEffect(() => {
    const app = getCurrentPages();
  }, []);

  return (<>
    <View></View>
  </>)
}

It can also be imported from the big package:

import {getCurrentPages} from 'universal-api';

Note:

  • Do not modify the page stack as this will lead to routing and page status errors.
  • Do not call getCurrentPages() when App.onLaunch is called since page is not generated.
/**
 * iframe: true
 */
import React from 'react';
export default () => (
  <iframe style={{
      boxShadow: '0 2px 15px rgba(0,0,0,0.1)',
      width: '375px',
      height: '700px'
    }} src='https://herbox.online/p/109000004/app_1aKtEd7SK?previewZoom=100&view=preview&defaultPage=pages/universal-getcurrentpages/index&topSlider=false'></iframe>
);
2.0.0-beta

4 years ago