React Infinity
made with React

React Infinity

这是UITableView的web实现。

相关问答
暂无相关问题
查看全部
简介及使用教程

React Infinity是iOS上针对Web的UITableView的实现。

它不只是用react.js重新包装了infinity.js,而是用具有最高的性能的React.js从头编写的,使用了TransitionGroup插件,每个元素进、出或移动都有动画效果。

安装

Npm

npm i react-infinity

Yarn

yarn add react-infinity

使用

var Infinity = require('react-infinity');

// ...
  Infinity({
    data: data, //Array of objects.
    elementWidth: 300, // Width of one element
    elementHeight: 300, // height of one element
    margin: 300,
    childComponent: ArticleCard, // React Class that will render actual cards. Must accept one object from the data array as props

    /* optional values:
    transitionable: // an object of type famous.Transitionable. transitionable.get() will replace window.scrollY
    mobileWidth: // breakpoint for switching to mobile view
    justifyOnMobile: // pass true to switch to a list instead of a grid on mobile.
    elementMobileHeight: // element height to use for mobile view
    elementMobileWidth: // element width to use for mobile view when `justifyOnMobile === false`
    scrollDelta: // Number of pixels from the top of the page to where React-Infinity is placed.
    */
  })
//...
作者

Naman Goel

相关项目