Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7 is out #252

Open
2 tasks done
dohomi opened this issue Apr 8, 2024 · 8 comments
Open
2 tasks done

v7 is out #252

dohomi opened this issue Apr 8, 2024 · 8 comments
Labels

Comments

@dohomi
Copy link
Owner

dohomi commented Apr 8, 2024

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

I released a new v7 beta with following breaking changes:

  • All '@mui/x-date-pickers' components are exported at react-hook-form-mui/date-pickers
  • @mui/x-date-pickers minimal version is raised to v7
  • react-hook-form-mui/date-fns is using v3 of date-fns
  • remove validation alias and use rules prop of react-hook-form

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
Copy link
Contributor

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
Copy link
Owner Author

dohomi commented Apr 8, 2024

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

@bethmaloney
Copy link
Contributor

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

@dohomi
Copy link
Owner Author

dohomi commented Apr 8, 2024

great, thanks for confirming 👍

@waza-ari waza-ari mentioned this issue Apr 12, 2024
2 tasks
@mikco11
Copy link

mikco11 commented Apr 26, 2024

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
Copy link
Owner Author

dohomi commented Apr 29, 2024

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
Copy link

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
Copy link
Owner Author

dohomi commented Aug 20, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants