Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: cannot use onFollow for TopNavigation identity #125

Closed
2 tasks done
6be709c0 opened this issue Aug 5, 2022 · 3 comments
Closed
2 tasks done

[Bug]: cannot use onFollow for TopNavigation identity #125

6be709c0 opened this issue Aug 5, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@6be709c0
Copy link

6be709c0 commented Aug 5, 2022

Browser

No response

Package version

3.0.13

React version

18.1.0

Description

I'd like to use the onFollow event for the top navigation link to avoid refreshing the full page but it's doesn't allow me to.
I think something must be wrong from typescript?

image

Source code

No response

Reproduction

No response

Code of Conduct

@6be709c0 6be709c0 added the bug Something isn't working label Aug 5, 2022
@timogasda
Copy link
Member

Hello!

It looks like you have a small typo in your code. When setting the onFollow property in TopNavigation you need to use : instead of = because you are passing an object:

<TopNavigation
  identity={{
    href: "/",
    title: "My Website",
    onFollow: (event) => { /* ... */ }
  }}
/>

@6be709c0
Copy link
Author

6be709c0 commented Aug 5, 2022

Omg I need to slee. I feel really stupid. Sorry.
You can delete this...

@timogasda
Copy link
Member

No worries at all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants