refactor: destructure loaderData in multiple components for cleaner code
This commit is contained in:
@@ -15,9 +15,8 @@ export const NewsDetailPage = () => {
|
||||
'routes/_news.detail.$slug',
|
||||
)
|
||||
const currentUrl = globalThis.location
|
||||
const { newsDetailData } = loaderData || {}
|
||||
const { title, content, featured_image, author, live_at, tags } =
|
||||
newsDetailData || {}
|
||||
loaderData?.newsDetailData || {}
|
||||
|
||||
const { text } = useReadingTime(content || '')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user