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

Support onClick funtion on Link component #8

Closed
Alex-Ferreli opened this issue Apr 23, 2019 · 2 comments
Closed

Support onClick funtion on Link component #8

Alex-Ferreli opened this issue Apr 23, 2019 · 2 comments

Comments

@Alex-Ferreli
Copy link

Hi @molefrog, nice plugin, i love the Hooks approace!

I have discovered that the Link component didn't accept a onClick prop to do something other then the normal behavior of navigate.

I have implemented the code to support this functionality locally, can i make a PR to merge with your package?

Thanks in advance!

@molefrog
Copy link
Owner

@Alex-Ferreli Sounds great, sure send the PR, would be glad to review it. And thanks for the kind words!
Do I get it right that what you're trying to achieve is to be able to attach an event handler, which will be fired after the transition happens? Sort of:

const afterNavigate = () => { console.log('navigated to /foo') }

<Link onClick={afterNavigate} href="/foo"><a>Click</a></Link>

@molefrog
Copy link
Owner

Closed via #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants