Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

driver-universal

alibaba2.9kBSD-3-Clause3.5.0TypeScript support: included

Driver for Universal App.

readme

driver-universal

Driver for Universal App.

Support both DOM(Web) and Weex, with normalized 750rpx support of screen width.

Install

$ npm install --save driver-universal

Use

import { createElement, render } from 'rax';
import View from 'rax-view';
import Image from 'rax-image';
import DriverUniversal from 'driver-universal';
function Example() {
  return (
    <View>
      <Image width="560" height="560" src="https://img.alicdn.com/tps/TB1z.55OFXXXXcLXXXXXXXXXXXX-560-560.jpg" />
    </View>
  );
}
render(<Example />, null, {
  driver: DriverUniversal
});

Driver unit difference

driver length value without unit 'rpx' unit
driver-dom Append 'px' unit Translate to 'vw'
driver-weex Append weex 'px' unit Translate to weex 'px'
driver-universal Append 'rpx' Translate to 'vw' in web, and translate to 'px' in weex

changelog

Changelog

v3.5.0

  • Chore: use import instead of require in entry file

v3.4.0

  • Chore: remove kraken driver, using web instead.

v3.3.1

  • Chore: remove Object.assign
  • Chore: add @babel/helpers for project size
  • Fix: require weex module is undefined

v3.3.0

  • Chore: reduce size by exports fields

v3.2.0

  • Support bytedance/baidu/kuaishou miniapp

v3.1.7

  • Bump version

v3.1.6

  • Use style-unit convert rpx