remove list jitter by initially preferring ssr

This commit is contained in:
keyan 2023-08-06 13:04:25 -05:00
parent eeaf6e10e5
commit 90f4d41fc8
5 changed files with 47 additions and 14 deletions

View File

@ -8,19 +8,21 @@ import { CommentFlat } from './comment'
import { SUB_ITEMS } from '../fragments/subs'
import { LIMIT } from '../lib/cursor'
import ItemFull from './item-full'
import { useData } from './use-data'
export default function Items ({ ssrData, variables = {}, query, destructureData, rank, noMoreText, Footer, filter = () => true }) {
const { data, fetchMore } = useQuery(query || SUB_ITEMS, { variables })
const Foooter = Footer || MoreFooter
const dat = useData(data, ssrData)
const { items, pins, cursor } = useMemo(() => {
if (!data && !ssrData) return {}