Select to view content in your preferred language

usage of react components outside of a widget

134
1
a month ago
WalaZargouni
Emerging Contributor

Hello everyone, is it possible de define a widget that renders partially ?

For example: i want to define custom react components outside of a widget (like in shared-code) and consume these components in the concerned widget without it really being there.

to be concise, i want to render a react component directly on the map for example without it being wrapped in a widget component, is it possible ?

I'm on ExB 1.17  

0 Kudos
1 Reply
JeffreyThompson2
MVP Frequent Contributor

I'm not sure what you are really trying to ask, but I will try to answer your questions as they are.

It's not possible to make a Widget that partially renders. React will crash if it does not return valid JSX at any point in time.

Can you define a React Component with in the shared-code folder? I have not tried it, but it should work. It's the primary reason the shared-code folder exists.

Anything rendered in Experience Builder will be part of the Widget class. If you want to place your Custom Widget on top of a Map Widget, that is perfectly valid.

GIS Developer
City of Arlington, Texas