Reactjs 当我在componentDidMount中设置标题时,如何在服务器端获取标题?
我想知道你是如何用ReactJS设置每页的标题的Reactjs 当我在componentDidMount中设置标题时,如何在服务器端获取标题?,reactjs,server,rendering,Reactjs,Server,Rendering,我想知道你是如何用ReactJS设置每页的标题的 对于渲染方法中的标题,应该使用状态变量,如果使用Redux,则应该使用Prop <title>{this.state.pageTitle}</title> componentDidMount(){ this.setState({pageTitle: pageDataStore.title}) }
对于渲染方法中的标题,应该使用状态变量,如果使用Redux,则应该使用Prop
<title>{this.state.pageTitle}</title>
componentDidMount(){
this.setState({pageTitle: pageDataStore.title})
}