react-native-test-rxstick
v0.0.13
Published
React Native rxstick of test handle.
Downloads
13
Maintainers
Readme
rxstick
小按钮 测试 用于测试
这个只是框架(也可以说是 入口),具体页面,以及功能需要自己定义。
simple test framework
Installation
Open a Terminal in the project root and run:
yarn add react-native-test-rxstick -dev
or if you use npm:
npm install react-native-test-rxstick --save-dev
Usage
import React from 'react';
import Stick, { RXTheme, RXRoot } from '../react-native-test-rxstick'
//第一种
import TestTheme from './xx/xx'
import TestRoot from './xx/xx'
export default class TestStick extends Stick {
constructor(props) {
super(props);
}
static allowAccess() {
return true;
}
static setTheme() {
// const TestTheme = require('./TestTheme').default; //第二种
RXTheme.update(TestTheme);
}
static setRoot() {
// const TestRoot = require('./TestRoot').default; //第二种
RXRoot.replaceComponent(<TestRoot />)
}
}
TestTheme (stick style)
export default {
stickBackgroundColor: '#FFF68F',
stickColor: '#00FFFF',
stickFontSize: 18,
}
TestRoot
// Component
My approach:
- Configure react native bundle packaging
- Replace the stick entry file before packaging, debug / release
我的处理方法:
- 配置react-native bundle打包
- 在打包前替换stick入口文件,debug/release