react-froala-wysiwyg icon indicating copy to clipboard operation
react-froala-wysiwyg copied to clipboard

How to pass dynamic parameters in autosave

Open andrew2558 opened this issue 3 years ago • 1 comments

In react hooks, the editor is created, but I found that the saveParams in config cannot be passed in dynamically, is there any way to pass in saveParams dynamically?

export default function GoEdit(props){
  const config={
    quickInsertEnabled:false,
    height:"500",
    saveURL: 'http://localhost:3000/save',
    saveParams: {
      id: props.id      // How does this Id dynamically change
    },
    saveParam: 'content',
    saveMethod: 'POST',
    saveInterval: 6000*5,
  }

  return (<Editor
    config={config}
    style={{height:"100%"}}
     />);
}

andrew2558 avatar Mar 11 '21 13:03 andrew2558

I want the id parameter to be a different value every time I save it

andrew2558 avatar Mar 12 '21 02:03 andrew2558