We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
很久没写文章了,这一次打算学习并介绍一次高阶组件
react 单页面应用,我需要在react-router-dom切换路由的时候,自动切换页面的title.希望能实现利用@autoTitle装饰器来实现这个功能.算是学习 react 第一步吧....
react-router-dom
@autoTitle
import React, { Component } from 'react'; const AutoTitle = title => (WrappedComponent) => class extends Component { constructor(){ super() document.title = title super.componentDidMount && super.componentDidMount() } render(h) { return <WrappedComponent {...this.props}/> } } export default AutoTitle;
The text was updated successfully, but these errors were encountered:
plh97
No branches or pull requests
前言
很久没写文章了,这一次打算学习并介绍一次高阶组件
background
react 单页面应用,我需要在
react-router-dom
切换路由的时候,自动切换页面的title.希望能实现利用@autoTitle
装饰器来实现这个功能.算是学习 react 第一步吧....AutoTitle 的高阶组件
The text was updated successfully, but these errors were encountered: