Skip to content

Instantly share code, notes, and snippets.

@AlexFrazer
Created June 15, 2017 16:02
Show Gist options
  • Save AlexFrazer/4196b451be45005c799af21e82f7d733 to your computer and use it in GitHub Desktop.
Save AlexFrazer/4196b451be45005c799af21e82f7d733 to your computer and use it in GitHub Desktop.
import React from 'react';
import { Link } from 'react-router';
type Props = {};
export default function Facet({
property,
value,
label,
...props,
}: Props) {
return (
<Link
to={(location) => ({
...location,
query: {
...location.query,
[property]: value,
}
})}
className={styles.facet}
activeClassName={styles.active}
>
{label}
</Link>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment