import React , { useEffect } from 'react' ; import { useSelector , useStore } from 'react-redux' ; import { loadLikeList } from '@app/redux/actions/like' ; import { getLikeListById } from '@app/redux/reducers/like' ; import ListClass from '@app/class/list' ; import Item from './item' ; import './styles/index.scss' ; interface Props { id : string ; query : object ; scrollLoad ? : boolean ; showPagination ? : boolean ; nothing ? : string ; } export default function ( props ) { const { id } = props ; const store = useStore ( ) ; const list = useSelector ( ( state ) => { return getLikeListById ( state , id ) ; } ) ; return ( < ListClass { ... props } { ... list } nothing = "" load = { ( params ) => loadLikeList ( params ) ( store . dispatch , store . getState ) } renderItem = { ( item , index ) => { return < Item data = { item } key = { item . _id } index = { index } / > ; } } />); }