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