sif-formik-to-rhf

Migrate a single Formik form to React Hook Form while preserving validation and data flow.

2|Updated Jun 3, 2022
One-click install
npx skills add https://github.com/navikt/sif-brukerdialog --skill sif-formik-to-rhf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sif-formik-to-rhf
Source: https://github.com/navikt/sif-brukerdialog/tree/main/.github/skills/sif-formik-to-rhf
Command: npx skills add https://github.com/navikt/sif-brukerdialog --skill sif-formik-to-rhf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrates a form from @navikt/sif-common-formik-ds (Formik) to @sif/rhf (React Hook Form) while preserving input behavior and data flow.

Core Features & Use Cases

  • Migrates a single form from Formik to RHF
  • Maintains identical field names, validation, and data mapping
  • Preserves i18n keys and error handling during migration

Quick Start

Provide a RHF-based migration for a given Formik form and output the updated component structure.

Frequently Asked Questions about sif-formik-to-rhf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a form from Formik to React Hook Form while preserving validation?

To migrate a form from Formik to React Hook Form (RHF), the process maps existing Formik patterns to RHF equivalents while preserving identical field names, validation rules, and data mapping. This ensures the form's input behavior and data flow remain unchanged during the transition.

What is the best way to maintain i18n keys when converting Formik forms to RHF?

Maintaining i18n keys during a Formik to RHF conversion involves directly preserving the existing internationalization identifiers within the new RHF component structure. The migration process ensures error handling and validation messages retain their original i18n keys and data shape.

Can I migrate a single form from @navikt/sif-common-formik-ds to @sif/rhf without changing data flow?

Yes, you can migrate a single form from @navikt/sif-common-formik-ds to @sif/rhf without changing data flow. The migration targets one form at a time, ensuring that exact enum-based FormFields, useSifValidate integration, and overall data mapping are strictly preserved.

How does the migration from Formik to RHF handle exact enum-based FormFields?

Migrating exact enum-based FormFields from Formik to RHF involves mapping the existing enum structures directly into the new React Hook Form schema. This satisfies integration requirements for RHF and useSafValidate while ensuring the field definitions and validation logic remain identical.

What are the limitations of migrating Formik forms to React Hook Form?

A key limitation of migrating Formik forms to React Hook Form is that the process is designed to be applied one single form at a time rather than migrating an entire application's schema at once. It focuses strictly on preserving existing behavior without introducing new validation logic.