• Как сделать страницу 404, в проекте, где внутри Route есть другие Route?

    maxfarseer
    @maxfarseer
    https://maxpfrontend.ru, обучаю реакту и компании
    Добавьте его 1 раз в самом низу.

    ReactDOM.render(
      <Router history={browserHistory}>
        <Route path="/" component={Layout}>
          <Route path="/sing" component={SignUp}/>
          <Route path="/profile" component={Profile} />
          <Route path="/register_approve" component={Validation} />
          <Route path="/forgot_password" component={ForgotPassword} />
          <Route path="/confirm_email" component={ConfirmEmail} />
          <Route path="/restore_password/:token" component={RestorePassword} />
          <Route path="/confirm_invite" component={ConfirmInvite} />
          <Route path="/my-cabinet" component={Cabinet} />
          <Route path="/members" component={Members} />
          <Route path="/invite-member" component={InviteMember} />
    
          <Route path="/not_access" component={NotAccess} />
    
          <Route path="/finance" component={Finance}>
            <Route path="/finance/project" component={FinanceProject}/>
            <Route path="/finance/fixed-costs" component={FinanceFixedCost}/>
            <Route path="/finance/fixed-costs" component={FinanceFixedCost}/>
            <Route path="/finance/salary" component={FinanceSalary}/>
            <Route path="/finance/other" component={FinanceOther}/>
          </Route>
        </Route>
        <Route path="*" component={NotFound} />
      </Router>,
      document.getElementById('root')
    Ответ написан
    2 комментария