I'm trying to pass as an attribute a key to a map, which could be an atom or a string. However, I cannot get the attribute definition to work so that it won't warn me when passing in the second type listed.
Source:
attr :src, :map, required: true
attr :key, :string | :atom, required: true
# usage
<.dx_label src={@profile} key={:surname} />
Thoughts?