Files
Hippy/docs/en-us/hippy-react/introduction.md

1.0 KiB

Introduction To Hippy-react

hippy-react is a React-to-native rendering layer redeveloped based on React's official custom renderer react-reconciler, which can use all of React's features. Now React17 is used.


Architecture Diagram

hippy-react 架构图

Initialization

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) {
    // Initialization parameters from native to front end.The native can put some custom properties required for startup into the entry file props
    super(props);
  }

  render() {
    const { __instanceId__: instanceId } = this.props;
    console.log('instanceId', instanceId);
    return (
      <View></View>
    );
  }
}