Skip to content

Custom List Views receive totally different props than documented #15416

@robinscholz

Description

@robinscholz
{
  collectionSlug: 'media',
  columnState: [
    {
      accessor: 'filename',
      active: true,
      field: [Object],
      Heading: [Object],
      renderedCells: [Array]
    },
    {
      accessor: 'alt',
      active: true,
      field: [Object],
      Heading: [Object],
      renderedCells: [Array]
    },
    {
      accessor: 'width',
      active: true,
      field: [Object],
      Heading: [Object],
      renderedCells: [Array]
    },
    {
      accessor: 'width',
      active: true,
      field: [Object],
      Heading: [Object],
      renderedCells: [Array]
    },
    {
      accessor: 'height',
      active: true,
      field: [Object],
      Heading: [Object],
      renderedCells: [Array]
    },
    {
      accessor: 'height',
      active: true,
      field: [Object],
      Heading: [Object],
      renderedCells: [Array]
    },
    {
      accessor: 'id',
      active: false,
      field: [Object],
      Heading: [Object],
      renderedCells: []
    },
    {
      accessor: 'storage',
      active: false,
      field: [Object],
      Heading: [Object],
      renderedCells: []
    },
    {
      accessor: 'folder',
      active: false,
      field: [Object],
      Heading: [Object],
      renderedCells: []
    },
    {
      accessor: 'updatedAt',
      active: false,
      field: [Object],
      Heading: [Object],
      renderedCells: []
    },
    {
      accessor: 'createdAt',
      active: false,
      field: [Object],
      Heading: [Object],
      renderedCells: []
    },
    {
      accessor: 'url',
      active: false,
      field: [Object],
      Heading: [Object],
      renderedCells: []
    },
    {
      accessor: 'thumbnailURL',
      active: false,
      field: [Object],
      Heading: [Object],
      renderedCells: []
    },
    {
      accessor: 'mimeType',
      active: false,
      field: [Object],
      Heading: [Object],
      renderedCells: []
    },
    {
      accessor: 'filesize',
      active: false,
      field: [Object],
      Heading: [Object],
      renderedCells: []
    }
  ],
  enableRowSelections: true,
  hasCreatePermission: true,
  hasDeletePermission: true,
  listPreferences: { listViewType: 'list', editViewType: 'default', limit: 50 },
  newDocumentURL: '/admin/collections/media/create',
  renderedFilters: Map(0) {},
  resolvedFilterOptions: Map(0) {},
  Table: {
    '$$typeof': Symbol(react.transitional.element),
    type: 'div',
    key: 'table',
    props: { className: 'table-wrap', children: [Object] },
    _owner: {
      name: 'ListView',
      key: null,
      env: 'Server',
      owner: [Object],
      stack: [],
      props: [Object],
      debugTask: [Object],
      debugStack: [Error: react-stack-top-frame],
      debugLocation: Error: react-stack-top-frame
          at Array.map (<anonymous>:1:18)
          at Array.reduce (<anonymous>:1:21)
    },
    _store: {}
  },
  viewType: 'list'
}

When replacing the List view with a custom component, I get the above console.log, when logging the props. This greatly differs from the documented list of props here.

The more I look into custom views, the more I feel like the functionality is not really production ready 😕 It would be great if someone from the team could clarify what’s possible here and what is not.

Metadata

Metadata

Assignees

Labels

area: docsImprovements or additions to documentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions