We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Similar to resolveData, we should consider a resolveFields method to allow users to dynamically set their fields based on the current props.
resolveData
resolveFields
Alternatively, we could piggy-back off resolveData and allow it to return a dynamic fields type.
This may also resolve #188.
Edit: Showing / hiding fields is possible using field overrides, which provide a suitable intermediary solution for some use cases.
Example that hides the image object field on the demo Hero component when the align property equals "center":
<Puck // ... overrides={{ fieldTypes: { object: ({ children, name }) => { const { selectedItem } = usePuck(); if (selectedItem.type === "Hero") { if ( selectedItem.props.align === "center" && name === "image" ) { return null; } } return <>{children}</>; }, }, }} />
The text was updated successfully, but these errors were encountered:
chrisvxd
Successfully merging a pull request may close this issue.
Similar to
resolveData
, we should consider aresolveFields
method to allow users to dynamically set their fields based on the current props.Alternatively, we could piggy-back off
resolveData
and allow it to return a dynamic fields type.This may also resolve #188.
Edit: Showing / hiding fields is possible using field overrides, which provide a suitable intermediary solution for some use cases.
Example that hides the image object field on the demo Hero component when the align property equals "center":
The text was updated successfully, but these errors were encountered: