0.0.10 • Published 7 years ago

universal-scroller v0.0.10

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

universal-scroller

Universal scroll component for react-native & web platform.

Usage

In web platform, we need import 'universal-scroller/index.web.js'. Or you can config your module manage system to load 'index.web.js' intelligently.

If you are using webpack, you can config resolve.extensions.

  {
    resolve: {
      extensions: ['.web.js', '.js'],
    },
  }

We are dependent on zscroller and scroller, so you can get almost all of options from here.

Web platform

import Scroller from 'universal-scroller';

const scroller = new Scroller(elmNode, {
  ...options,
  onScroll: (left, top, zoom) => {
    console.log(left, top, zoom);
  },
});

React-native platform

import React, { Component } from 'react';
import {
  Text,
} from 'react-native';
import Scroller from 'universal-scroller';

class List extends Component {
  render() {
    return (
      <Scroller
        {...options}
        onScroll={(left, top, zoom) => {
          console.log(left, top, zoom);
        }}
      >
        <Text>hello<Text>
      </Scroller>
    );
  }
}

TODO

  • React native zoom
  • React web version
0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago