Skip to content

Property Inheritance #1088

Closed Answered by a-h
claritydistro-nick asked this question in Q&A
Mar 4, 2025 · 1 comments · 2 replies

You must be logged in to vote

There's a section in the docs about it: https://templ.guide/syntax-and-usage/context/#prop-drilling

Don't forget that templ components are just Go code that has a Render method. You could probably implement a context provider component that sets the value and renders children, passing the context.

There's some examples of code components like templ.Once or templ.Flush and you should see how you can make a context setter.

Replies: 1 comment 2 replies

You must be logged in to vote
2 replies
@a-h

a-h Mar 17, 2025
Maintainer

Answer selected by claritydistro-nick
@claritydistro-nick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants