0

Sorry new to TypeScript and I am using React ace builds and I am getting this error:

Warning: Failed prop type: Invalid prop value of type array supplied to ReactAce, expected string.

In the /node_modules/react-ace-builds folder there is a types.d.ts file and there is a declaration here:

export interface AceEditorProps {
  /** other types **/
  value?: string;
  /** other types **/
} 

But I am using it like in the docs:

  <DiffEditor
    value={["Test code differences", "Test code difference"]}
    height="1000px"
    width="1000px"
    mode="text"
  />,

I tried this solution from this question...

type DiffEditorOverridingValueProp = Omit<DiffEditor, 'value'> & { value: any }; 


  <DiffEditorOverridingValueProp
    DiffEditorOverridingValueProp={["Test code differences", "Test code difference"]}
    height="1000px"
    width="1000px"
    mode="text"
  />,

But that does not work! Any ideas what I am doing wrong?

Antonio Pavicevac-Ortiz
  • 7,239
  • 17
  • 68
  • 141

0 Answers0