I am trying to build a fill-in-the-blank style component. It consists of some text with one or more input boxes inside the text. The number and location of the input boxes varies from text to text so the component must be dynamically built. My question is: what is the best way to store this on a database and fetch it for rendering?
My attempt at a solution:
- Create a component which has the text and input boxes appropriately placed
- Store the entire component JSX in the database and fetch it when requested
- Render the fetched JSX in a container component
I think this would work but I'm wondering if there is a better way since it seems a bit hacky to store the entire component JSX on a database.