I wonder how can I set a context variable inside a route definition so that its parent could get this information?
For instance how to set the context.myParam in the following example:
compose(
withView((request, context) => (
const param = context.myParam // <==
return (
<DefaultPageLayout param={param}>
<View/>
</DefaultPageLayout>
)
),
mount({
"/some-route": route({
// ??? I take it I can do it here somehow
})
})
)
I'd highly discourage this pattern, but that said, if you set an object on the context you should be able to mutate its properties from a child -- just like a React ref object.
I wonder how can I set a context variable inside a route definition so that its parent could get this information?
For instance how to set the
context.myParam
in the following example: