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

Similar to how route.options.meta() already behaves it would be nice to pass the loaderData and match to the links() function as well. #2426

Open
SeanCassiere opened this issue Sep 27, 2024 · 1 comment · May be fixed by #2427

Comments

@SeanCassiere
Copy link
Member

Similar to how route.options.meta() already behaves it would be nice to pass the loaderData and match to the links() function as well.

For my specific use-case I want to generate a canonical link element that is rendered via the Meta component inside the head. To do this I need some data from the current match and loaderData. Those are available inside meta() but not inside links().

Originally posted by @lo1tuma in #2419

@SeanCassiere
Copy link
Member Author

It could be worth exploring @lo1tuma suggestion here.

The only consideration I see here is that we'd now be expecting links() to be executed only after the loader has completed. Therefore, you wouldn't be able to resolve links() into the <head> before the loader has completed its work.

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

Successfully merging a pull request may close this issue.

1 participant