forge42dev / remix-hook-form

Open source wrapper for react-hook-form aimed at Remix.run
MIT License
330 stars 27 forks source link

'mode' does not exist in type 'UseRemixFormOptions' #69

Closed geeron closed 8 months ago

geeron commented 8 months ago

Tried implementing the first example in the readme, but there is a type error:

Screenshot 2024-01-15 at 20 07 58

Object literal may only specify known properties, and 'mode' does not exist in type 'UseRemixFormOptions<{ name: string; email: string; }>'.ts(2353)

    "remix-hook-form": "^4.0.0",
    "zod": "^3.22.4"
    "@hookform/resolvers": "^3.3.4",

All deps:

"dependencies": {
    "@hookform/resolvers": "^3.3.4",
    "@remix-run/css-bundle": "^2.5.0",
    "@remix-run/node": "^2.5.0",
    "@remix-run/react": "^2.5.0",
    "@remix-run/serve": "^2.5.0",
    "drizzle-orm": "^0.29.3",
    "isbot": "^4.1.0",
    "pg": "^8.11.3",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "remix-hook-form": "^4.0.0",
    "zod": "^3.22.4"
  },
  "devDependencies": {
    "@playwright/test": "^1.40.1",
    "@remix-run/dev": "^2.5.0",
    "@types/node": "^20.11.0",
    "@types/pg": "^8.10.9",
    "@types/react": "^18.2.20",
    "@types/react-dom": "^18.2.7",
    "@typescript-eslint/eslint-plugin": "^6.7.4",
    "daisyui": "^4.6.0",
    "drizzle-kit": "^0.20.12",
    "eslint": "^8.38.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-import-resolver-typescript": "^3.6.1",
    "eslint-plugin-import": "^2.28.1",
    "eslint-plugin-jsx-a11y": "^6.7.1",
    "eslint-plugin-react": "^7.33.2",
    "eslint-plugin-react-hooks": "^4.6.0",
    "tailwindcss": "^3.4.1",
    "typescript": "^5.1.6"
  },
AlemTuzlak commented 8 months ago

@geeron you need to have react-hook-form installed as well, it's a peer dependency of the package

geeron commented 8 months ago

@AlemTuzlak Ok, thanks for clarifying and your awesome work. I made a PR with some suggested changes to the readme. In the future, would it make sense to automatically install react-hook-form as a dependency of remix-hook-form itself so we don't have to install react-hook-formmanually?

AlemTuzlak commented 8 months ago

@geeron Not really because the idea is that you pick your own version of react-hook-form rather than being tied to what I set it as because this wrapper should work with any version. I'll check out the PR as well soon!