#i need help with link or href

24 messages · Page 1 of 1 (latest)

glad minnow
#

I write the code, and I have App.tsx (the main site), and I have a button with href='auth.tsx', when I click on the button on the site, the url changes, but it does not transfer to the site itself, the code is below, help pls <3

floral locust
#

!screenshot

tranquil auroraBOT
#
`!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.

floral locust
#

@glad minnow are you using React Router?

#

(also, I don't recommend using React.FC to type your components, see this GitHub PR)

glad minnow
#

it's a problem because of React.FC?

floral locust
#

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

glad minnow
#

and have problem with "component"

floral locust
#
<Route path="/auth" Component={Auth} />
``` and not
```jsx
<Route path="/auth" component={Auth} />
``` I think
glad minnow
#

there are no problems, but when compiling

floral locust
#

you should have mentionned you are using Remix

#

sounds like something important to mention

#

also

#

error is in the typings