2.0.0-beta • Published 4 years ago
universal-getapp v2.0.0-beta
group: title: Application
title: getApp
getApp
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