#Using OutletContext inside MetaFunction

1 messages · Page 1 of 1 (latest)

spare sparrow
#

Is there a way to get the values from OutletContext inside the MetaFunction? I'm passing some expensive data down via OutletContext and I haven't found any examples of using that in the MetaFunction. Thanks!

#

@dry seal

dry seal
#

I don't think so - any reason you can't expose the data through your loader which Meta would have access to?

spare sparrow
#

That route has no loader, I'd have to refetch the data for not a whole lot of benefit on this route. Sort of defeats the purpose of using OutletContext at that point. Can I access the OutletContext in the loader? Actually, I think that parent loader may be an approach.

#

Yeah that works for me. Just had to grab the parents loader data.

dry seal
#

yeah - meta gets all the loader data from parents too 👍

lucid topaz
#

Btw OutletContext is more for custom states, for accessing parent loaders use useMatches donde all loaders data is already there