Reactjs 为什么router.push会使用next.js重新加载/重新呈现页面?

Reactjs 为什么router.push会使用next.js重新加载/重新呈现页面?,reactjs,react-native,next.js,Reactjs,React Native,Next.js,在我的组件中,我有: return ( <TouchableRipple onPress={() => router.push(`/conversations/${props.item.id}`)} style={{ marginBottom: 50 }}> <Surface style={{ height: 200, flex: 1, flexDirection: 'row', justifyContent: 'flex-

在我的组件中,我有:

    return (
        <TouchableRipple onPress={() => router.push(`/conversations/${props.item.id}`)} style={{ marginBottom: 50 }}>
            <Surface style={{ height: 200, flex: 1, flexDirection: 'row', justifyContent: 'flex-start', borderRadius: customTheme.roundness, elevation: customTheme.elevation }}>
返回(
router.push(`/conversations/${props.item.id}`)style={{{marginBottom:50}}>

它会转到
/conversations/1
,但会重新播放整个页面。我是否遗漏了一些内容?

您是否尝试用括号代替

<TouchableRipple onPress={() => router.push(`/conversations/[props.item.id]`)} style={{ marginBottom: 50 }}>
router.push(`/conversations/[props.item.id]`)style={{{marginBottom:50}}>

您需要为推送提供两个参数,以使其不重新加载:

router.push(
  `/conversations/query-param=${props.item.id}`,
  `/conversations/${props.item.id}`
)

query param
是对话中使用的命名参数

如果您在对话页面中使用getInitialProps,那么它将为您刷新页面,您需要使用

无骰子-仍然执行rerender@Shamoon您可以尝试保留网络选项卡信息和控制台。查看是否有任何内容无法加载或ca使用错误。