0.1.0 • Published 4 years ago

react-native-magic-list v0.1.0

Weekly downloads
51
License
-
Repository
github
Last release
4 years ago

react-native-magic-list

animate for FlatList items.

1. Examples

2. Basic Usage

how to use react-native-magic-list?:

npm install react-native-magic-list --save

example for how to use in Demo:

import React from 'react';
import { View } from 'react-native';
import { MagicFlatList } from 'react-native-magic-list';

const mockedData = Array(10).fill(1);

export class Demo extends React.Component {
	render() {
		return (
			<MagicFlatList
				data={mockedData}
				animateType='floatFromBottom'
				renderItem={() => (
					<View style={{ width: 100, height: 100, backgroundColor: 'red' }} />
				)}
			/>
		);
	}
}
  • props:
keydescriptiontypedefault
renderItemRendering componentfunction() => void
delayeach item's delaynumber200
animateTypeEntry animation typearray or string'floatFromBottom'
onCompletecallback when the animation is all overfunctionnull
FlatList.propTypesInherit FlatList's propTypesanynull
  • Supported animation types
// base
'floatFromBottomBig';
'floatFromBottom';
'floatFromTop';
'floatFromLeft';
'floatFromRight';
'scale';
'opacity';

// mixin
'fadeIn';
'fadeInDown';
'fadeInLeft';
'fadeInRight';
'fadeInUp';
'slideInUp';
'slideInDown';
'slideInLeft';
'slideInRight';
'zoomIn';
'zoomDownIn';
'zoomUpIn';
'zoomInRight';
'zoomInLeft';

When you need to use the entrance animation you can choose the following two ways: animateType="floatFromBottom" or animateType="floatFromBottom", '"floatFromLeft", But if you use a hybrid animation, only the top one will work, and the rest of the base animations won't work.

sorry, now touchAnimateType is not going to work, we will fix it as soon.