I don't have access to "handleChange"

Hello!

I am in the process of finishing creating a custom render library with React and Vitejs as the module bundler.

The problem occurs when I compile the application (React / Vitejs) which uses this library in production

When I try to edit a field, the “handleChange(path, value)” function is not called. I also tried to console.log the dispatch function through “useJsonForms()”, but I have a return to undefined

2021.11.25-22.58.04.screenshot

I have spent a fair amount of time trying to resolve this problem, but I have no clue.

I thank you in advance for the help you can give me

Example of a control

const TextControl = (props: Props) => {
  const { data, path, schema, enabled, handleChange } = props

  return (
    <TextField
      disabled={!enabled}
      value={data}
      onChange={value => handleChange(path, value)}
      {...schema}
    />
  )
}

export const textControlRegistration: JsonFormsRendererRegistryEntry = {
  tester: rankWith(1, isStringControl),
  renderer: withJsonFormsControlProps(withFormField(TextControl)),
}

Hi @cdegrel,

the handleChange is injected via withJsonFormsControlProps. When it’s not there in your custom renderer then this means that the withFormField HOC did not hand it over to TextControl. So you need to check the implementation of withFormField and modify it accordingly.