strapi-plugin-import-export-entries
Version:
Import/Export data from and to your database in just few clicks.
16 lines (11 loc) • 330 B
JavaScript
import { useState } from 'react';
export const useForm = (attributes) => {
const [options, setOptions] = useState(attributes);
const getOption = (key) => {
return options[key];
};
const setOption = (key, value) => {
setOptions({ ...options, [key]: value });
};
return { options, getOption, setOption };
};