fix(NodeSwitcher): return null during SSR to avoid hydration mismatch
Build and Deploy / Build and Push Docker Image (push) Successful in 1m57s
Build and Deploy / Build and Push Docker Image (push) Successful in 1m57s
This commit is contained in:
@@ -26,6 +26,9 @@ export function NodeSwitcher() {
|
|||||||
setSelected(activeInterconnectNodeId || 'local')
|
setSelected(activeInterconnectNodeId || 'local')
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
// SSR 时返回 null,避免 hydration 错误
|
||||||
|
if (!mounted) return null
|
||||||
|
|
||||||
const fetchNodes = useCallback(async () => {
|
const fetchNodes = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getNodes()
|
const res = await getNodes()
|
||||||
|
|||||||
Reference in New Issue
Block a user