Skip to content

Hooks

Custom React hooks provide reusable logic for common CMS operations.

Generic hook for entity CRUD operations:

const { data, loading, error, create, update, delete } = useEntity('pages');

Manages current locale and translations:

const { locale, setLocale, t } = useLocale();

Authentication state and user management:

const { user, login, logout, hasPermission } = useAuth();

Media upload and management:

const { upload, files, loading } = useMedia();

Form state management with validation:

const { register, handleSubmit, errors } = useForm(schema);

This section will be expanded with detailed hook implementations.