Skip to content

Instantly share code, notes, and snippets.

@larkintuckerllc
Created March 7, 2022 19:31
Show Gist options
  • Save larkintuckerllc/7dd008b4ddd7bf19bc02f9ab74490195 to your computer and use it in GitHub Desktop.
Save larkintuckerllc/7dd008b4ddd7bf19bc02f9ab74490195 to your computer and use it in GitHub Desktop.
import React from 'react';
import { useEntity } from '@backstage/plugin-catalog-react';
import { useMyPluginObjects } from '../../hooks/useMyPluginObjects'
export const ExampleComponent = () => {
const { entity } = useEntity();
const { error, loading, status } = useMyPluginObjects();
if (loading) {
return <div>Loading</div>;
}
if (error) {
return <div>Error</div>;
}
return (<>
<div>Hello {entity.metadata.name}</div>
<div>Status: {status}</div>
</>);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment