React js – creating a parent component with variable amount of child components.

Problem: Had a “option” box I was creating where there could be any number of “tags” that can be added for that option.

Solution: Created a context local to the parent/children components only, kept a separate variable to manually track how many “groups” of options has been requested by the user. Used an array of objects and updated according to index which is sent in as a prop to each set of options. Example code

Here are the Parent and child components

Parent:

Child: