2

I'm trying to create new pages and use them in the production build. i added my page component to the renderRoutes file like this :

import React from 'react';
import { Switch, Route } from 'react-router-dom';
import { Page } from '@magento/peregrine';
import ErrorView from 'src/components/ErrorView/index';

import RoutesTypes from './authentication';
// components
import MyPage from 'src/components/MyPage';

const { PrivateRoute, GuestRoute } = RoutesTypes;
const renderRoutingError = props => <ErrorView {...props} />;

const renderRoutes = () => (
    <Switch>
        <Route
            exact
            name="profile"
            staticName={true}
            path="/account/profile.html"
            component={MyPage}
        />
        <Route render={() => <Page>{renderRoutingError}</Page>} />
    </Switch>
);

export default renderRoutes;

and going to /account/profile.html does fully work as intended, but while the page is loading, this shows up : image

Is there a way to remove that not found in the title and body while the page is loading?

  • @Manashvi Birla - I don't see why this on hold for being unclear, seems perfectly obvious what is being asked. It's a common question for REACT and as PWA Studio is new to Magento, it's very relevant to this SO – Holly Mar 21 '19 at 11:24
  • you need to add componentDidMount() { document.title = 'Your Page Title'; } to your <MyPage> component file, before the render method. – Holly Mar 21 '19 at 11:26

Browse other questions tagged or ask your own question.