owned this note changed 7 years ago
Linked with GitHub

Native, React Native, and Modularization

tags: 2018, R3
位置: R3
講者:曾漢源


React Native

可以製作android、ios、windows phone。
完成一份code,執行在不同的平台。

Component base,可以模組化,以積木形式堆砌產品。
由不同team製作不同模組,再加以組合成app。

APP Modularization

  • UI Component
  • Data Component
  • Nework Component
  • Utils

模組的切法需要經驗,才能整合需求的共通點,成為一個好的Component。

import { Banner } from 'mopcon-react-native-banner';

<Banner 
    data={this._createMockBannerData()}
    indicatorNonActiveColor={Color.white}
    indicatorActiveColor={Color.blue.shade_900}
    autoPlay={true}
    autoPlayInterval={3000}
    onPagerItemPress={this._testOnBannerPageItemPress}/>

dependencies

Add module as dependency into package.json in your React Native project.

"dependecies": {
    ...
    "mopcon-react-native-banner",
    "git+ssh://git@gitlab.mopcon.com:Demo/mopcon_itemgroup.git:v1.0.5",
    ...
}

Native Module

Jave Kotlin 及 Objective-C swift
用 RCTBridge 與React Native連接。

Select a repo