-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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.0.0-alpha.5 #11414
v7.0.0-alpha.5 #11414
Conversation
Deploy preview: https://deploy-preview-11414--material-ui-x.netlify.app/ |
Co-authored-by: Lukas <llukas.tyla@gmail.com> Signed-off-by: Bilal Shafi <bilalshafidev@gmail.com>
Co-authored-by: Lukas <llukas.tyla@gmail.com> Signed-off-by: Bilal Shafi <bilalshafidev@gmail.com>
- [pickers] Fix field types to avoid error on latest `@types/react` version (#11397) @LukasTy | ||
- [pickers] Remove all relative imports to the internals index file (#11375) @flaviendelangle | ||
- [pickers] Rename slots interfaces (#11339) @alexfauquette | ||
- [pickers] Simplify the API of the field hooks (#11371) @flaviendelangle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We missed the BCs for this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops too late, packages published.
Please share them and I'll open another PR and update the release notes too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's never too late to update the changelog or release notes. 👌 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Move
inputRef
inside the props passed to the field hooksThe field hooks now only receive the props instead of an object containing both the props and the
inputRef
.- const { inputRef, ...otherProps } = props - const fieldResponse = useDateField({ props: otherProps, inputRef }); + const fieldResponse = useDateField(props);
If you are using a multi input range field hook, the same applies to
startInputRef
andendInputRef
params- const { inputRef: startInputRef, ...otherStartTextFieldProps } = startTextFieldProps - const { inputRef: endInputRef, ...otherEndTextFieldProps } = endTextFieldProps const fieldResponse = useMultiInputDateRangeField({ sharedProps, - startTextFieldProps: otherStartTextFieldProps, - endTextFieldProps: otherEndTextFieldProps, - startInputRef - endInputRef, + startTextFieldProps, + endTextFieldProps });
-
Rename the ref returned by the field hooks to
inputRef
When used with the v6 TextField approach (where the input is an
<input />
HTML element), the field hooks return a ref that needs to be passed to the<input />
element.
This ref was previously namedref
and has been renamedinputRef
for extra clarity.const fieldResponse = useDateField(props); - return <input ref={fieldResponse.ref} /> + return <input ref={fieldResponse.inputRef} />
If you are using a multi input range field hook, the same applies to the ref in the
startDate
andendDate
objectsconst fieldResponse = useDateField(props); return ( <div> - <input ref={fieldResponse.startDate.ref} /> + <input ref={fieldResponse.startDate.inputRef} /> <span>–</span> - <input ref={fieldResponse.endDate.ref} /> + <input ref={fieldResponse.endDate.inputRef} /> </div> )
-
Restructure the API of
useClearableField
The
useClearableField
hook API has been simplified to now take aprops
parameter instead of afieldProps
,InputProps
,clearable
,onClear
,slots
andslotProps
parameters.You should now be able to directly pass the returned value from your field hook (e.g:
useDateField
) touseClearableField
const fieldResponse = useDateField(props); - const { InputProps, onClear, clearable, slots, slotProps, ...otherFieldProps } = fieldResponse - const { InputProps: ProcessedInputProps, fieldProps: processedFieldProps } = useClearableField({ - fieldProps: otherFieldProps, - InputProps, - clearable, - onClear, - slots, - slotProps, - }); - - return <MyCustomTextField {...processedFieldProps} InputProps={ProcessedInputProps} /> + const processedFieldProps = useClearableField(fieldResponse); + + return <MyCustomTextField {...processedFieldProps} />
Release the packages
yarn
.yarn release:build
.yarn release:publish
(you need your 2FA device).yarn release:tag
.Publish the documentation
The documentation must be updated on the
docs-vX
branch (docs-v4
forv4.X
releases,docs-v5
forv5.X
releases, ...)You can follow the deployment process on the Netlify Dashboard
Once deployed, it will be accessible at https://material-ui-x.netlify.app/ for the
docs-next
deployment.Publish GitHub release