You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an uidl that has elements with elementType: group and when I use this uidl to generate a component I want to map this elementType to Fragment.
Now, I thought this was possible through mappings but I think there's an issue:
In resolveElementoriginalElement.semanticType has precedence on mappedElement.elementType wich is ok, but what I don't understand is, resolveElement is called in resolveNode wich is called in resolveUIDL after setFriendlyOutputOptions that will add a default semanticType to the element, so when it go to resolveElement the element will always have a semanticType.
Is this a bug? Or is just the expected behaviour to not replace the elementType on generateComponent flow?
eg. use case:
I have an uidl that has elements with
elementType: group
and when I use this uidl to generate a component I want to map this elementType toFragment
.Now, I thought this was possible through mappings but I think there's an issue:
In
resolveElement
originalElement.semanticType
has precedence onmappedElement.elementType
wich is ok, but what I don't understand is,resolveElement
is called inresolveNode
wich is called inresolveUIDL
aftersetFriendlyOutputOptions
that will add a defaultsemanticType
to the element, so when it go toresolveElement
the element will always have asemanticType
.Is this a bug? Or is just the expected behaviour to not replace the
elementType
ongenerateComponent
flow?Here's the sandbox of the example above https://codesandbox.io/p/sandbox/custom-component-generator-forked-rcz39t?file=%2Fsrc%2Findex.js
The text was updated successfully, but these errors were encountered: