Skip to content
loading...

re: How to add a dynamic title on your React app VIEW POST

FULL DISCUSSION
 
// routes.js

import React from 'react';
import { Route } from 'react-router';
import { TitleComponent } from './TitleComponent.jsx';

// withTitle function
const withTitle = ({ component: Component, title }) => {
    return class Title extends Component {
        render() {
            return (
                <React.Fragment>
                    <HelmetComponent title={title} />
                    <Component {...this.props} />
                </React.Fragment>
            );
        }
    };
};

I think you have mistakenly used HelmetComponent instead of TitleComponent.

 
code of conduct - report abuse