JsonFormsDispatch seems not to be working on embedded layouts (React Native)

Hi! I have a custom implementation of JsonForms for React Native. I’ve been creating renderers and added functionality to render forms. That is working well! I want to have multi-layouts support. So I created custom vertical and group layouts. They work well along. When I tried to combine those (group layouts inside a vertical layout) the renderers are not being rendering. Seems like something is happening with JsonFormsDispatch.

So this is my VerticalLayout:

<JsonFormsLayout
      uischema={uischema}
      schema={schema}
      visible={visible}
      enabled={enabled}
      path={path}
      orientation="vertical"
    >
      <ChildrenRenderer schema={schema} path={path} layout={verticalLayout} />
    </JsonFormsLayout>

JsonFormsLayout:

 <ScrollView
      style={{
        flex: 1,
        flexDirection,
      }}
    >
      {/* eslint-disable-next-line react/destructuring-assignment */}
      {props.children}
    </ScrollView>

ChildrenRenderer

<View style={{ flex: 1, flexDirection: 'column' }}>
    {(layout.elements || []).map((child: any, index: number) => (
      <View style={{ flex: 1, flexDirection: 'column' }}>
        <JsonFormsDispatch
        /* eslint-disable-next-line react/no-array-index-key */
          key={`${path}-${index}`}
          uischema={child}
          schema={schema}
          path={path}
          visible
        />
      </View>
    ))}
  </View>

Basically group layout is based on vertical layout but it adds a label as a title.

Hi @leo,

On the first glance it mostly looks fine, however as you did not post all the code I can’t really understand the whole flow.

What seems weird to me:

  • Why does JsonFormsLayout receive uischema, schema etc.? Does it actually do something with them?
  • In your VerticalLayout you seem to have uischema and verticalLayout variables. What is the difference between them and how are they determined?
  • Did you check whether there are any layout.elements to iterate over? If you actually dispatch, do you check which renderers where actually invoked?
  • Why does JsonFormsLayout receive uischema, schema etc.? Does it actually do something with them?

Actually is not doing something with it, that means I can remove it.

  • Did you check whether there are any layout.elements to iterate over? If you actually dispatch, do you check which renderers were actually invoked?

I’ll try to find out if contains elements, it should but I’m going to make sure.