我想将静态getInitialProps中的代码移到componentDidMount中。但是,getInitialProps中有两个参数(component,ctx),我应该全部使用它们。我只想知道我能不能移动代码。谢谢!. // Current public static async getInitialProps({Compone
我想在我的应用程序中创建一个特殊的页面,在没有在服务器上呈现页面的情况下,提供一些保存在本地存储中的信息。我只能实际设置来自componentDidMount的数据,因为我需要访问localStorage (不起作用)。在Node env。显然)。(await Page.getInitialProps(ctx)), language } const { language }没有办法