#i need help with link or href
24 messages · Page 1 of 1 (latest)
!screenshot
Rather than screenshots, please provide either code formatted as:
```ts
// code here
```
Or even better, as an example on the TypeScript playground that is as simple as possible and reproduces the issue. This makes it easier to help you and increases the chances of getting an answer.
@glad minnow are you using React Router?
(also, I don't recommend using React.FC to type your components, see this GitHub PR)
I tried, but I have a lot of mistakes, and this is how I do it for the coursework
it's a problem because of React.FC?
no
types don't exist at runtime
if you are using React Router, you should be using <Link /> for your links
if a link is on a different domain, React Router will see that and will instead open the right website
also, you should use absolute or relative links
that either start with ./, ../, or /
if you want to go to the Auth page, the url should be /auth
<header>
<Router>
<div className="header-content">
<nav>
<ul>
<li><a href="#">Головна</a></li>
<li><a href="#">Інформація</a></li>
</ul>
</nav>
<nav>
<ul>
<li><Link to="./auth">Авторизація</Link></li>
</ul>
</nav>
</div>
<Route path="/auth" component={Auth} />
</Router>
</header>
``` its in body
and
and have problem with "component"
<Route path="/auth" Component={Auth} />
``` and not
```jsx
<Route path="/auth" component={Auth} />
``` I think