history push

This commit is contained in:
Primakov Alexandr Alexandrovich 2024-10-24 18:59:32 +03:00
parent 008c2d3cb7
commit c28721b1f4

View File

@ -1,17 +1,25 @@
import React from "react";
import { Link } from "react-router-dom";
import { URLs } from "../../__data__/urls";
import { getHistory } from '@brojs/cli'
import { getNavigationsValue } from "@brojs/cli";
import { URLs } from "../../__data__/urls";
const history = getHistory();
export const ProfilePage = () => {
const handletoNav2Click = (event) => {
event.preventDefault()
history.push(getNavigationsValue('nav2.main'));
}
return (
<div>
<h1>profile page</h1>
<Link to={URLs.about.getUrl()}>go to about page</Link>
<div>
<a href={getNavigationsValue('nav2.main')}>edit profile</a>
<a onClick={handletoNav2Click} href={getNavigationsValue('nav2.main')}>edit profile</a>
</div>
</div>
);