Expose actionData inside the meta function #3524
kenneth-gray
started this conversation in
Proposals
Replies: 1 comment
-
Raised a simpler change (just adding Things to consider (copied from PR):
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Feature request
Would it be possible to run the meta function with the data coming back from the action as well as the loader?
The API for
meta
could look like this:in place of
Why?
I'd like to be able to change the document title of a page based on what is being returned by the action. In my particular case I'd like to prefix the title with
Error:
when there are validation errors on the page. Useful for accessibility when JS fails to load (or is explicitly disabled) for screen readers, because it's the first thing that is announced on page load.I can work around the JS only version for now by using
document.title = `Error: ${document.title}`
(being careful to check that this hasn't already been done), but this wouldn't work for the non-JS experience.Example
Beta Was this translation helpful? Give feedback.
All reactions