Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Last active June 24, 2019 08:45
Show Gist options
  • Save koss-lebedev/4323b0921cf6c297bd5e3c8e3aaa5568 to your computer and use it in GitHub Desktop.
Save koss-lebedev/4323b0921cf6c297bd5e3c8e3aaa5568 to your computer and use it in GitHub Desktop.
import React, { useEffect, FC } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import UserList from '../../components/UserList'
import { RootState, RootDispatch } from '../../store'
const Users: FC = () => {
const users = useSelector((state: RootState) => state.users)
const dispatch = useDispatch<RootDispatch>()
useEffect(() => {
dispatch.users.load()
}, [])
return <UserList users={users} />
}
export default Users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment