2.0.0-beta • Published 4 years ago

universal-getapp v2.0.0-beta

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

group: title: Application

title: getApp

getApp

npm npm

Gets the globally unique App instance of the Mini Program.

Support

Install

$ npm install universal-getapp --save

Usage

import { createElement, useEffect, Fragment } from 'rax';
import getApp from 'universal-getapp';

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

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

It can also be imported from the big package:

import {getApp} from 'universal-api';
/**
 * 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-getapp/index&topSlider=false'></iframe>
);
2.0.0-beta

4 years ago