File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 1- import React , { memo , useState } from 'react' ;
1+ import React , { memo , useMemo , useState } from 'react' ;
22import { ListRenderItemInfo } from 'react-native' ;
33
4+ import { faker } from '@faker-js/faker' ;
45import ReorderableList , {
56 ReorderableListReorderEvent ,
67 reorderItems ,
@@ -13,7 +14,6 @@ import {
1314 ListItemProps ,
1415 SeedDataItem ,
1516 usePanGesture ,
16- useSeedData ,
1717} from './common' ;
1818
1919export const ActiveItem : React . FC < ListItemProps > = memo ( props => {
@@ -28,7 +28,24 @@ export const ActiveItem: React.FC<ListItemProps> = memo(props => {
2828} ) ;
2929
3030export const ActiveItemScreen = ( ) => {
31- const seedData = useSeedData ( ) ;
31+ const seedData : SeedDataItem [ ] = useMemo (
32+ ( ) =>
33+ faker . helpers . multiple (
34+ ( ) => ( {
35+ id : faker . string . uuid ( ) ,
36+ image : faker . image . urlPicsumPhotos ( {
37+ width : 50 ,
38+ height : 50 ,
39+ } ) ,
40+ title : faker . book . title ( ) ,
41+ description : faker . book . genre ( ) ,
42+ } ) ,
43+ {
44+ count : 20 ,
45+ } ,
46+ ) ,
47+ [ ] ,
48+ ) ;
3249 const [ data , setData ] = useState ( seedData ) ;
3350 const panGesture = usePanGesture ( ) ;
3451
You can’t perform that action at this time.
0 commit comments