cf-component-link
Advanced tools
Comparing version 4.2.2 to 4.2.3
{ | ||
"name": "cf-component-link", | ||
"description": "Cloudflare Link Component", | ||
"version": "4.2.2", | ||
"version": "4.2.3", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "module": "es/index.js", |
@@ -6,5 +6,8 @@ # cf-component-link | ||
## Installation | ||
Installation with yarn is recommended | ||
```sh | ||
$ npm install cf-component-link | ||
$ yarn add cf-component-link | ||
``` | ||
@@ -26,8 +29,12 @@ | ||
<div> | ||
<p>Create a <code>Link</code> with a <code>to</code> prop:</p> | ||
<p> | ||
Create a <code>Link</code> with a <code>to</code> prop: | ||
</p> | ||
<Link to="/">Link to /</Link> | ||
<p>Alternatively you can pass an <code>onClick</code> handler:</p> | ||
<p> | ||
Alternatively you can pass an <code>onClick</code> handler: | ||
</p> | ||
<Link onClick={this.handleClick.bind(this)}>Link to something</Link> | ||
<p>Note: This will give it a <code>role="button"</code></p> | ||
<p>{`Note: This will give it a <code>role="button"</code>`}</p> | ||
@@ -37,6 +44,12 @@ <p> | ||
</p> | ||
<Link to="/foo" className="special-link">Link to /foo</Link> | ||
<Link to="/foo" className="special-link"> | ||
Link to /foo | ||
</Link> | ||
<p>You can even specify <code>tagName</code>:</p> | ||
<Link to="/bar" tagName="button">Link to /bar</Link> | ||
<p> | ||
You can even specify <code>tagName</code>: | ||
</p> | ||
<Link to="/bar" tagName="button"> | ||
Link to /bar | ||
</Link> | ||
</div> | ||
@@ -48,6 +61,5 @@ ); | ||
export default LinkComponent; | ||
``` | ||
Note: This requires that you setup | ||
[`cf-util-route-handler`](https://www.npmjs.com/package/cf-util-route-handler) | ||
prior to routing. | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10862
8
62