@brightleaf/react-hooks
Advanced tools
Comparing version 0.13.0 to 0.14.0
@@ -90,2 +90,14 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "useStyles", { | ||
enumerable: true, | ||
get: function () { | ||
return _useStyles.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "useStyleSheet", { | ||
enumerable: true, | ||
get: function () { | ||
return _useStylesheet.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "useTitle", { | ||
@@ -132,2 +144,6 @@ enumerable: true, | ||
var _useStyles = _interopRequireDefault(require("./use-styles")); | ||
var _useStylesheet = _interopRequireDefault(require("./use-stylesheet")); | ||
var _useTitle = _interopRequireDefault(require("./use-title")); | ||
@@ -134,0 +150,0 @@ |
{ | ||
"name": "@brightleaf/react-hooks", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"description": "Useful react hooks", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -19,3 +19,7 @@ # Brightleaf React Hooks | ||
* `useTitle` - Hook to manipulate the page title | ||
* `useStyles` - Hook to add CSS to the page | ||
* `useStyleSheet` - Hook to add a css file to the page | ||
[Examples](https://brightleaf.github.io/react-hooks/examples/#/) | ||
## Async Hook | ||
@@ -69,2 +73,3 @@ | ||
``` | ||
## Keypress Hook | ||
@@ -89,3 +94,2 @@ | ||
} | ||
``` | ||
@@ -323,6 +327,54 @@ | ||
Hover Over Me | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
``` | ||
## Style Hook | ||
```javascript | ||
import React from 'react' | ||
import { useStyles } from '@brightleaf/react-hooks' | ||
export default () => { | ||
useStyles(` | ||
html, | ||
body { | ||
font-family: 'Open Sans'; | ||
} | ||
div { | ||
padding: 5px; | ||
border: 1px solid #ccc; | ||
} | ||
`) | ||
return ( | ||
<div> | ||
<div> | ||
Something | ||
</div> | ||
</div> | ||
); | ||
} | ||
``` | ||
## StyleSheet Hook | ||
```javascript | ||
import React from 'react' | ||
import { useStyleSheet } from '@brightleaf/react-hooks' | ||
export default () => { | ||
useStyleSheet( | ||
'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' | ||
) | ||
useStyleSheet('https://fonts.googleapis.com/css?family=Open+Sans') | ||
return ( | ||
<div> | ||
... | ||
</div> | ||
); | ||
} | ||
``` |
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
41961
26
1157
376