SolidJSS
SolidJS12mo ago
2 replies
snorbi

Related components

How would you implement a <Form> and <ValidatedField> component?
<Form>
  <ValidedField ... />
  <ValidedField ... />
</Form>

Where e.g. you could force the validation of all nested ValidatedField components, and e.g. make the first one with errors focused?
What is the recommended way to implement such relations between components? How can components "know about each other", especially about their parent? Is this always implemented by using context and props? For example can I pass a "parent component context object" to the nested components where they can register themselves dynamically?
Thanks.
Was this page helpful?