Description
This is a demo project that does not inherit the RNAbilty and switches from the native page to the RN page.
Directory Structure
RNProject -- RN project NativeProject -- Native project
Environment Setup
- In the
entrydirectory, run ohpm i @rnoh/react-native-openharmony@x.x.x to install the dependency. - Check whether the
oh-modulesfolder is generated in theNativeProject,entry, andlibrarydirectories. - Run npm i @react-native-oh/react-native-harmony@x.x.x in
RNProject/MainProjectto install the dependency. - Run npm run dev in
RNProject/MainProjectto generate the bundle. - Open
NativeProjectin DevEco Studio and run Sync and Refresh Project. - Click File > Project Structure > Signing Configs, log in and complete the signing.
- Click run in the upper right corner to start the project.