Hyperprops
Connect the web of linked data to presentational react components.
import {provide} from "hyperprops";
const resource = provide(
{
'foaf': 'http://xmlns.com/foaf/0.1/'
}
);
const Link = ({href, label}) => <a href={href}>{label}</a>;
const PersonLink = resource(
Link,
["href", "label"],
[],
{
href: "@id",
label: "foaf:name",
}
);
Usage:
<PersonLink id="https://angelo.veltens.org/profile/card#me"/>
Debug mode
const PersonLink = resource(
Link,
["href", "label"], [],
{
href: "@id",
label: "foaf:name",
},
{ debug: true }
);