Hi team, I'm trying to use `EmbeddedListSearch` in...
# ui
b
Hi team, I'm trying to use
EmbeddedListSearch
inside
TagProfileDrawer
and I'm getting the
import/no-cycle
error. Is there any way to get around this? It's not clear how
EmbeddedListSearch
is importing
TagProfileDrawer
. Thanks in advance!
b
Hey Lena! I checked this out and it appears like the dependency cycle is occurring because
EmbeddedListSearch
ultimately renders
TagProfileDrawer
on search result cards (
EmbeddedListSearch
->
EntityNameList
->
TagTermGroup
->
TagProfileDrawer
). So on build, React gets stuck in an infinite cycle of this component trying to import itself. May I ask what your goal for adding
EmbeddedListSearch
to the
TagProfileDrawer
is? cycles like these can be tough to break, but depending on your use case there could be a couple of different solutions!
b
Hi @bulky-soccer-26729 thank you so much for looking into this. I'm trying to render Related Entities in the profile drawer. Our team wants Related Entities field instead of the
Applied to
field.
b
yeah unfortunately that might be a challenge given the current setup of everything if we try to reuse the same search cards in the current tag drawer. However, if we did something like make a tag its own entity page instead of a drawer I believe this would work! the real issue is that this cycle occurs when we try to import and render these things that cycle back to each other. But if we broke the cycle by creating a new page and routing to it or something like that, this would be all good. Or rendering a new list of entities that doesn't have these same tag components that also import the drawer itself..
b
thanks chris - i ended up making copies of the components without the tags!
👍 1