dohomi / react-hook-form-mui

Material-UI form components ready to use with react-hook-form
https://react-hook-form-material-ui.vercel.app
MIT License
539 stars 108 forks source link

v7 is out #252

Open dohomi opened 6 months ago

dohomi commented 6 months ago

Duplicates

Latest version

Summary 💡

I released a new v7 beta with following breaking changes:

The changed export of date-pickers hopefully reduces bundle size of integrations where a date picker is not part of the forms.

In v6 there was an inconsistency on how to add validation rules, some component used a validation prop, some the rules prop. The validation prop is removed in all components and now the rules prop is used.

Examples 🌈



// before:
import {DatePickerElement} from 'react-hook-form-mui'

// after: moved all pickers to its own exported member
import {DatePickerElement} from 'react-hook-form-mui/date-pickers'

// before:
<TextFieldElement validation={{required: 'This field is required'}}/>

// after: removed the validation prop and replaced it with rules
<TextFieldElement rules={{required: 'This field is required'}} />
bethmaloney commented 6 months ago

I can't import the DatePickerElement. Not sure if I'm doing something wrong?

image

Attached an example project using npm create vite@latest to create a default React project.

test-mui-hook.zip

dohomi commented 6 months ago

can you upgrade to beta.3? Also make sure if you use ts to maybe change your tsconfig.json to moduleResolution: node16 | NodeNext

bethmaloney commented 6 months ago

@dohomi Thanks upgrading to beta.3 resolved the issue. I didn't have to adjust the moduleResolution from its default value.

dohomi commented 6 months ago

great, thanks for confirming 👍

mikco11 commented 5 months ago

can you upgrade to beta.3? Also make sure if you use ts to maybe change your tsconfig.json to moduleResolution: node16 | NodeNext

None of those help me. This is my original tsconfig

{
  "compilerOptions": {
    "target": "es6",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "noUncheckedIndexedAccess": true,
    "jsx": "react-jsx",
    "baseUrl": "src"
  },
  "include": ["src", "test"]
}

I have been using this package for last couple of days in v7 but it has been only nightmare and frustration, along other bugs/issues. So many hours wasted. Unfortunately I recently upgraded MUI-X datepicker to v7 and i dont plan to go back to v6.

Please fix imports ASAP. For now i guess I will have to go with react-hook-form only.

dohomi commented 5 months ago

with words like ASAP you won't move me anywhere - this is public code and nobody got paid to provide the codebase. You even didn't create a Codepen with your issue so what am I supposed to look into? Its obvious that there is an issue relies in your installation and package integration and your comment is zero help to identify what the issue might be.

jbove-dd commented 1 month ago

Hi @dohomi , first of all, thanks for making this library! I was wondering about the releases and versions and if v7 would become the main release at some time? Asking because the versioning on npm has the latest as v7.0.1, but the github tags are missing for versions after tag "6.0.0", which makes it difficult to see what has changed in relation to which version.

dohomi commented 1 month ago

@jbove-dd I havent found a good github tagging tool yet, thats why there isn't a reliable tagging of Github included. v7 is out for a while and the major changes are hightlighted above.