Skip to content

Provide a more explanatory example project #6

Open
@humbkr

Description

@humbkr

Hi, thanks for your work.

I spent hours trying to customise a property in the list without any success, and I'd like some pointers.

My project uses

  • nest.js
  • typescript
  • adminBro

I'm following the docs to the letter.
In the configuration I added:

{ resource: styleModel, options: {
          properties: {
            parentId: {
              components: {
                list: AdminBro.bundle('./components/reference-in-list'),
              },
            }
          }
        } },

My ./components/reference-in-list is defined as the following:

import React from 'react'
import { InputGroup, Label } from '@admin-bro/design-system'
import { BasePropertyProps } from 'admin-bro'

const ReferenceInList: React.FC<BasePropertyProps> = (props) => {
  const { record, property } = props
  const value = record.params[property.name]

  return (
    <InputGroup>
      <Label>{property.name}</Label>
      {value}
    </InputGroup>
    )
}

export default ReferenceInList

All I got is an error:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Is there any special configuration to add when using adminBro with nest.js?
There are no docs on your website for using your product with nest.js and the example-app is very basic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions