rnxteam / Rnplus
RNX 的前端拓展框架
Stars: ✭ 25
Programming Languages
javascript
184084 projects - #8 most used programming language
Labels
Projects that are alternatives of or similar to Rnplus
Found
Extensible route-based routing for React applications
Stars: ✭ 718 (+2772%)
Mutual labels: router
Storeon Async Router
Asynchronous router for Storeon. It provides possibility for prefetch the data, lazy load, navigation cancellation, and routes modification on the fly.
Stars: ✭ 22 (-12%)
Mutual labels: router
Rapid.js
An ORM-like Interface and a Router For Your API Requests
Stars: ✭ 700 (+2700%)
Mutual labels: router
Jsoo router
A small router to write easily single-page-app in Js_of_ocaml
Stars: ✭ 24 (-4%)
Mutual labels: router
Koa Dec Router
An ES6 decorator + class based router, support inherit, override, priority, auto load controllers, etc.
Stars: ✭ 19 (-24%)
Mutual labels: router
Lion
Lion is a fast HTTP router for building modern scalable modular REST APIs in Go
Stars: ✭ 750 (+2900%)
Mutual labels: router
Multiprocessrouter
一个多进程路由框架,使用APT处理路由接口的注册和初始化。多个模块间可以进行IPC调用。
Stars: ✭ 18 (-28%)
Mutual labels: router
Androuter
A android router framework used to map url to activities or actions.
Stars: ✭ 730 (+2820%)
Mutual labels: router
Flutter thrio
flutter_thrio makes it easy and fast to add flutter to existing mobile applications, and provide a simple and consistent navigator APIs.
Stars: ✭ 717 (+2768%)
Mutual labels: router
Xunlei Fastdick
迅雷快鸟 Xunlei Network Accelerator For Router
Stars: ✭ 789 (+3056%)
Mutual labels: router
Vmesh
VMesh is a decentralized Layer 3 mesh router and protocol designed for open network interconnection.
Stars: ✭ 25 (+0%)
Mutual labels: router
Vecty Router
A declarative client-side router for Vecty applications.
Stars: ✭ 24 (-4%)
Mutual labels: router
RNPlus
RNPlus 是 React Native 的前端拓展框架,简化并增强前端开发。
配合使用 rnxDemo,阅读该文档,风味更佳哦~
介绍
- Base: 核心、插件机制、Utils
- Router: 路由部分,包括同 Context 内的路由,以及和 Native View 之间的跳转
- Redux:数据部分,与 Router 结合的单向数据流操作
- Webx: 前端扩展部分,包括对 Style 的扩展和对事件的一些改动
开始
// 引入 RNPlus
import {
PView,
PComponent,
} from 'rnplus';
// 定义一个页面
class PageA extends PView {
// ...
};
// 定义一个组件
class MyComp extends PComponent {
// ...
};
核心API
业务开发者 API
PView 和 PComponent
开发者可以通过 class Demo extends PView {}
或 class Demo extends PComponent {}
的方式创建 RNPlus View 或 Component,并使用 RNPlus 的插件。
例:
class Demo extends PView {
render() {
return <Text>Hello, RNPlus!</Text>
}
}
注意:
不要修改对 PView
和 PComponent
的引用。以下写法是无效的:
// 无效的写法
const MyView = PView;
class Demo extends MyView {
render() {
return <Text>Hello, RNPlus!</Text>
}
}
之所以这样是因为 RNPlus 为方便开发,会通过配套的 babel 插件自动完成注册。如果你一定要像上面那样,你也可以通过以下方式手动完成注册:
const MyView = PView;
class Demo extends MyView {
render() {
return <Text>Hello, RNPlus!</Text>
}
}
// 手动注册
Demo = RNPlus.register(Demo, 'Demo');
RNPlus.defaults
全局配置,用户可以配置一些全局的设置。
默认配置:
RNPlus.defaults = {
appName: '',
globalPlugins: ['webx', 'router', 'redux'],
};
插件文档
暂见各自 README.md
插件开发者 API
RNPlus.addPlugin(name, adapter, ininFn, registerFn);
添加插件
-
name
:{String}
插件名 -
adapter
:{Function}
适配器 -
ininFn
:{Function}
RNPlus 初始化回调函数 -
registerFn
:{Function}
PView/PComponent 注册时回调函数
示例
RNPlus.addPlugin('xxx', (Comp, opts, React, isView) => {
// Comp : React Comp 组件实例
// opts : 插件配置
// React : React 对象
// isView : 是否是 View (有可能是 Component)
}, (React) => {
// React : React 对象
}, (RNPlusComp, isView) {
// RNPlusComp : RNPlus Comp 组件 Class (PView/PComponent)
// isView : 是否是 View (有可能是 Component)
});
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].