Hello, I’m writing a plugin with a custom type field.
To do it I’m simply creating new plugin, make components directory and write a new component.
All is working - but I’m need to obtain values from all strapi fields in my component.
I was able to access the content of all fields using this technic:
Copy original strapi Inputs component from strapi-plugin-content-manager to :
extensions/content-manager/admin/src/components/Inputs/index.js
Add at the top Inputs/index.js
import EditViewDataManagerContext from "../../contexts/EditViewDataManager";
before return write:
const context = React.useContext(EditViewDataManagerContext);
I’m try to use this technic in my plugin component:
plugins/colorpicker/admin/src/components/colorPicker/index.js
But after call this code inside local plugin:
In extensions/content-manager/admin/src/components/RepeatableComponent/DraggedItem/index.js I get the value of the field with const value = get(modifiedData, keys, null);
Where:
modifiedData is const {modifiedData} = useDataManager(); keys is const keys = ${componentFieldName}.${name};
and obviously get is from lodash.