import React, { useState } from 'react'; import { useSelector } from 'react-redux'; import Conversation from './Conversation'; // import { swr } from '~/utils/fetchers'; import useDidMountEffect from '~/hooks/useDidMountEffect'; export default function Conversations() { const [isHovering, setIsHovering] = useState(false); const { conversationId } = useSelector((state) => state.convo); // useDidMountEffect(() => mutate(), [conversationId]); // const currentRef = useRef(null); // const scrollToTop = () => { // currentRef.current?.scrollIntoView({ behavior: 'smooth' }); // }; // // this useEffect triggers the following warning in the Messages component (but not here): // // Warning: Internal React error: Expected static flag was missing. // useEffect(() => { // scrollToTop(); // }, [conversationId]); return (
setIsHovering(true)} onMouseLeave={() => setIsHovering(false)} >
{/*
*/} {conversations && conversations.map((convo, i) => ( ))} {conversations && conversations.length >= 12 && ( )}
); }