Update modifiedData by injected components logic

System Information
  • **Strapi Versio **: 4
  • Operating System:
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:


I injected a custom component into the content-manager plugin as described in the documentation. There we can use usecmeditviewdatamanager() to get acces to the data with the modifiedData object.

But i want to modify that data object with my component’s logic and want to listen to the save action, to do further actions. How can i do that?


To update your data you can use the onChange method from the useCMEditViewDataManager Hook,

  const { modifiedData, onChange } = useCMEditViewDataManager();
      target: { name: "name_of_field", value: "new value" },
1 Like