What is the best way to retrieve template argument outside the template?

If you want the user to be able to change (read/write access) the colors, then yes you will need a state-variable. They can use user-colors.update(...) without context and it will change for all content that relies on the color provided you used the state there.

However, for simple access, you will need context indeed and it will return content, see here: Why is the value I receive from context always content? - #2 by laurmaedje

1 Like