Custom join field or how to use RelationshipTable component #9049
-
I am trying to create a custom import { JoinField } from 'payload'
export const locationSectorsField: JoinField = {
name: 'sectors',
type: 'join',
collection: 'sectors',
on: 'location',
defaultSort: 'order',
admin: {
components: {
Field: '@/collections/Locations/fields/LocationSectorsField',
},
},
} Component 'use client'
import React, { useMemo } from 'react'
import type { JoinFieldClient, JoinFieldClientComponent, PaginatedDocs, Where } from 'payload'
import { fieldBaseClass, FieldLabel } from '@payloadcms/ui'
import { useFieldProps } from '@payloadcms/ui'
import { useField } from '@payloadcms/ui'
import { useDocumentInfo } from '@payloadcms/ui'
//import { RelationshipTable } from '@/components/RelationshipTable'
import { RelationshipTable } from '@payloadcms/ui/elements/RelationshipTable'
import { withCondition } from '@/components/withCondition'
const JoinFieldComponent: JoinFieldClientComponent = function JoinFieldComponent(props) {
// ...
} If I copy the entire import { RelationshipTable } from '@/components/RelationshipTable' So the question is, how can we use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If you need the component exported, you can open an issue. |
Beta Was this translation helpful? Give feedback.
-
Here here! #10084 |
Beta Was this translation helpful? Give feedback.
Here here! #10084