You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
399 B
JavaScript
25 lines
399 B
JavaScript
"use strict";
|
|
|
|
const React = require("react");
|
|
|
|
const context = require("./context");
|
|
|
|
function Link(props) {
|
|
let { handle } = React.useContext(context);
|
|
|
|
let {
|
|
url, children,
|
|
/* The following is covered by the `url` prop already. */
|
|
href: _href,
|
|
...rest
|
|
} = props;
|
|
|
|
return (
|
|
<a href="#" onClick={() => handle("get", url)} {...rest}>
|
|
{children}
|
|
</a>
|
|
);
|
|
}
|
|
|
|
module.exports = Link;
|