import React, { useState, useEffect } from 'react'; import { Poll, User } from 'which-types'; import Feed from '../../components/Feed/Feed'; import { get } from '../../requests'; import PollSubmission from './PollSubmission'; interface PropTypes { navigate: (prefix: string, id: string) => void; user: User | undefined; } const FeedPage: React.FC = ({ navigate, user }) => { const [polls, setPolls] = useState([]); useEffect(() => { get('/feed').then(response => { setPolls(response.data); }); }, []); return ( <> {user && } ); }; export default FeedPage;