Skip to content

Using renderField in version 6.4 #996

@omerfaran

Description

@omerfaran

Describe the bug
Hello!

I migrated from react-awesome-query-builder version 5.4 to:
"@react-awesome-query-builder/mui": "^6.4.2"

In my code I'm customizing the config:


import { MuiConfig, BasicConfig } from '@react-awesome-query-builder/mui';

    const _customConfigWithTheme: BasicConfig = {
      ...MuiConfig,
      settings: {
        ...MuiConfig.settings,
        renderField: (props) => (
          <WithTheme theme={theme}>
            {
              MuiConfig.settings.renderField?.(props) // THIS LINE THROWS THE ERROR
            }
          </WithTheme>
        ),

That worked fine without any issues in version 5.4, but in version 6.4, I'm getting the error:

Uncaught TypeError: Cannot read properties of undefined (reading 'RCE')

The error is emerging from the line MuiConfig.settings.renderField?.(props), where I added the comment.

To Reproduce
Create a config with the above data

Expected behavior
Should not throw

Thanks a lot in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions