Currently, I am utilizing a function to dynamically generate input-groups based on the number chosen by the user:
const tag = (tag, className, props = {}) =>
Object.assign(document.createElement(tag), {className, ...props});
Everything is functioning correctly except when I include a hyphenated field in the call like
tag("div", "collapse", {id: "card" + cardCount, data-parent: "#parentList"}))
Whenever 'data-parent' attribute is used, it triggers an error. I even tried using ['data-parent'] but still encountered the same issue. How can I resolve this and make it work?