I would like to reuse the form from
collection-slug/create
inside my custom collection list view.
I know that I can overwrite any default components in the collection config, but is there a way to import and use the default components or do I have to build the form from scratch?
Hey
@217604129776861185sorry for the delay here - you can import the different fields individually from
payload/components
. We'll be making it easier to reuse Payload components in the near future, keep tabs on progress here
https://github.com/payloadcms/payload/discussions/293Any updates to the reusing of components?
Do you know where I can find the collapsible field to import into a custom react component?
Hi
@919477830927130655- we're still working on the reusable component library. You can find the code for the collapsible field here:
https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/components/forms/field-types/Collapsible/index.tsxWhat would the import statement look like in the react .tsx file ? I'm currently using
import { CollapsibleField } from "payload/components/forms";
but getting the error:
Module '"payload/components/forms"' has no exported member 'CollapsibleField'
Star
Discord
online
Get dedicated engineering support directly from the Payload team.