mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-17 04:41:51 +08:00
c8908b38aa
* docs(doc): update doc path * docs(doc): update doc path * docs(doc): update doc path * docs(doc): update doc path * docs(doc): update doc for 3.0 * docs(doc): update doc for 3.0 * docs(doc): update doc for 3.0 * docs(doc): update doc for 3.0 * docs(doc): update doc for 3.0 --------- Co-authored-by: OpenHippy <124017524+open-hippy@users.noreply.github.com>
1012 B
1012 B
hippy-react 介绍
hippy-react 是基于 React 的官方自定义渲染器 react-reconciler 重新开发的 React 到终端的渲染层,可以使用 React 的全部特性,当前采用 React17。
架构图
初始化
import { Hippy, View } from '@hippy/react';
import React, { Component } from 'react';
new Hippy({
appName: 'Demo',
entryPage: App,
// set global bubbles, default is false
bubbles: false,
// set log output, default is false
silent: false,
}).start();
class App extends Component {
constructor(props) {
// 终端给前端的初始化参数,终端可以将一些启动需要的自定义属性放到入口文件props里
super(props);
}
render() {
const { __instanceId__: instanceId } = this.props;
console.log('instanceId', instanceId);
return (
<View></View>
);
}
}