Closed mathiasrw closed 5 years ago
If you go to the Moon Slack page, Help section, I asked Kabir how to do something very close to what you're asking. https://moonjs.slack.com/messages/C78U8RUCE/ (scroll up and you'll see what I'm asking).
Yes, it is possible through arguments. Any data you pass to a component through the attributes in your template are automatically added to its state. See this section in the documentation for more.
Is it possible to pass data to a component?
Example:
Lets say i have a component displaying a button.
I would like to iterate over a list of words and calling the button component in a way so the button can display the right name.
I guess what i am asking is actually: how can a component access data from the context in which it was "called"