Provide data
and error
to Layout function
#8846
aaronadamsCA
started this conversation in
Proposals
Replies: 1 comment 4 replies
-
You can get the root data with I'm not sure if you can also call useRouteError too. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to suggest providing the new
Layout
function with (supported) access todata
anderror
.This would let us do the same kinds of things in
Layout
that we can already do today inmeta
and with our own customDocument
components, such as:This shows a props-based API, but of course it could also be hook-based.
I think it's important because:
Layout
is probably the best place for global tags now, for all the reasons already described in the docs.<style>
tags, can't be inserted using themeta
API anyway.For now the workaround is to not use
Layout
, I think. (Or you could try callinguseLoaderData()
and/oruseRouteError()
in yourLayout
component, but I bet that's going to break some things!)Beta Was this translation helpful? Give feedback.
All reactions