Pluggable Views
Last updated
Last updated
import { usePluggableView } from "uxp/components";
const PortfolioView = () => {
// Define pluggable view point
const renderSummary = usePluggableView({
viewId: 'Location/summary',
defaultPage: DefaultSummaryComponent
});
return (
<div>
{/* Render the pluggable summary */}
{renderSummary()}
</div>
);
};const DetailsView = ({ locationKey }) => {
const renderDetailsPanel = usePluggableView({
viewId: 'Location/details',
defaultPage: LocationDetailsComponent
});
return (
<div>
{/* Pass props */}
{renderDetailsPanel({
locationKey: locationKey,
view: 'standalone'
})}
</div>
);
};