How to pass mendix context to react native component

0
I am creating mendix native widget. I need to use mendix context. Using following for props. But still not getting mendix context. Any solutions which I can refer to interface WrapperProps extends NativeCustomWidgetProps<Style>{ mxform: mxui.lib.form._FormBase; mxObject : mendix.lib.MxObject; mxContext : mendix.lib.MxContext "class"?: string; friendlyId: string; }  
asked
1 answers
1

Hi Omkar,

Normally, loading Mendix objects into a React widget is done in one of two ways:. Did you try the below?

  1. If widget is in a data view, use the type=’attribute’ in the widget XML
  2. If widget needs to load it's own Mendix objects, use type=’datasource’

 

If you use the ‘pluggable-widget-tools’ by which a React widget is advised by Mendix to be built via Visual Studio Code, then setting up your widget XML like this will generate the typings to use the Mendix objects in the props. You could use my Google Maps Custom Marker (React) widget to check this. There are proper examples in the code.

 

answered