Pattern matching dictionary and HTML valid id


I have been working with pattern matching callback for a while now.
However, today a colleague makes myself noticed that giving id={“type”:mytype, “index”:myindex} to a html.Div for instance generates un html <div id =“{“type”:mytype, “index”:myindex}” >…
that does not respect the html syntax

*value* A unique alphanumeric string. The id value must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (-), underscores (_), colons (:), and periods (.).

How abort this issue?

Hello @a.orhand,

Welcome to the community!

This is correct, pattern-matching does break the typical recommendations for html components. I do not think that there is a way to adjust this due to the nature of how it works.

1 Like