mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 15:09:47 +00:00
perf: make display more natural (#2)
This commit is contained in:
@@ -262,7 +262,12 @@ export function NotionPage({
|
||||
|
||||
// Use state to store filtered recordMap, initialized with original
|
||||
const [filteredRecordMap, setFilteredRecordMap] =
|
||||
React.useState<types.ExtendedRecordMap | undefined>(recordMap)
|
||||
React.useState<types.ExtendedRecordMap | undefined>(() => {
|
||||
if (config.isI18nEnabled && recordMap) {
|
||||
return filterRecordMapByLanguage(recordMap, 'en')
|
||||
}
|
||||
return recordMap
|
||||
})
|
||||
|
||||
// Apply language filtering only after mount to avoid hydration mismatch
|
||||
React.useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user