File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ def index
1212 render inertia : {
1313 topics : topics ,
1414 trending_topics : calculate_trending_topics ( topics )
15+ # trending_topics: InertiaRails.optional { calculate_trending_topics(topics) }
1516 # trending_topics: InertiaRails.defer { calculate_trending_topics(topics) }
1617 }
1718 end
Original file line number Diff line number Diff line change 1- import { Head } from '@inertiajs/react'
1+ // import { useEffect } from 'react'
2+ import { Head /*, router, usePage */ } from '@inertiajs/react'
23import AppLayout from '../../layouts/AppLayout'
34import { Topic } from '../../types'
45import TopicsTable from '../../components/TopicsTable'
56
67function TopicsIndex ( { topics, trending_topics } : { topics : Topic [ ] , trending_topics : number [ ] } ) {
8+ /*
9+ const {url} = usePage();
10+
11+ useEffect(() => {
12+ // router.reload({only: ['trending_topics']})
13+
14+ router.visit(url, {
15+ only: ['trending_topics'],
16+ preserveState: true,
17+ });
18+ }, [])
19+ */
20+
721 return (
822 < AppLayout >
923 < Head title = "Topics - Pups & Pourovers" />
You can’t perform that action at this time.
0 commit comments