github mui/mui-x v6.0.0-alpha.1

latest releases: v8.0.0-alpha.0, v7.22.2, v7.22.1...
pre-release2 years ago

We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:

@mui/x-data-grid@v6.0.0-alpha.1 / @mui/x-data-grid-pro@v6.0.0-alpha.1 / @mui/x-data-grid-premium@v6.0.0-alpha.1

Breaking changes

  • New internal rows structure for v6 (#4927) @flaviendelangle

    Some selectors related to the rows have been renamed to better describe the type of rows they are returning:

    -const result = gridRowsIdToIdLookupSelector(apiRef);
    +const result = gridRowsDataRowIdToIdLookupSelector(apiRef);
    -const result = gridRowTreeDepthSelector(apiRef);
    +const result = gridRowMaximumTreeDepthSelector(apiRef);

    The format of the tree nodes (the element accessible in params.node or with the apiRef.current.getRowNode method) have changed.
    You have a new type property, which can be useful, for example, to apply custom behavior on groups.
    Here is an example of the old and new approach showing how to apply a custom value formatter in groups for the grouping column:

     <DataGridPremium 
       groupingColDef={() => ({
         valueFormatter: (params) => {
           if (params.id == null) {
             return params.value;
           }
    
           const rowNode = apiRef.current.getRowNode(params.id!)!;
    -      if (rowNode.children?.length) {
    +      if (rowNode.type === 'group') {
             return `by ${rowNode.groupingKey ?? ''}`;
           }
    
           return params.value;
         }
       })}
     />
  • The GridFeatureModeConstant constant no longer exists (#6077) @DanailH

    -import { GridFeatureModeConstant } from '@mui/x-data-grid';

Changes

@mui/x-date-pickers@v6.0.0-alpha.1 / @mui/x-date-pickers-pro@v6.0.0-alpha.1

Breaking changes

  • [pickers] Do not support unparsed date formats anymore (#6170) @flaviendelangle

    The value prop of the pickers now expects a parsed value.
    Until now, it was possible to provide any format that your date management library was able to parse.
    For instance, you could pass value={new Date()} when using AdapterDayjs.

    This brought a lot of confusion so we decided to remove this behavior.
    The format expected by the value prop is now the same as for any other prop holding a date.
    Here is the syntax to initialize a date picker at the current date for each adapter:

    // Date-fns
    <DatePicker value={new Date()} />
    
    // Dayjs
    import dayjs from 'dayjs'
    <DatePicker value={dayjs()} />
    
    // Moment
    import moment from 'moment'
    <DatePicker value={moment()} />
    
    // Luxon
    import { DateTime } from 'luxon'
    <DatePicker value={DateTime.now()} />

Changes

Docs

Core

Don't miss a new mui-x release

NewReleases is sending notifications on new releases.