Comparing version 1.0.3 to 1.0.4
@@ -52,4 +52,4 @@ "use strict"; | ||
return (react_1.default.createElement("svg", Object.assign({}, restProps), | ||
react_1.default.createElement("use", { xlinkHref: `#${injector_1.injector.getId(src)}` }))); | ||
react_1.default.createElement("use", { href: `#${injector_1.injector.getId(src)}` }))); | ||
}; | ||
exports.HandySvg = HandySvg; |
{ | ||
"name": "handy-svg", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "The most handy way to use <svg> on the web", | ||
@@ -5,0 +5,0 @@ "main": "src/index.tsx", |
@@ -8,6 +8,6 @@ <img width="200" alt="handy_svg" src="https://user-images.githubusercontent.com/2974415/162402689-e1382bba-9fe1-4bf8-8d45-bc28a78ab5c7.png"> | ||
## How it works | ||
1. Fetches your svgs in browser with `fetch` request. And caches of course. | ||
2. Puts it into [svg-sprite](https://daily-dev-tips.com/posts/svg-sprites/) that is stored in your `body`. | ||
1. Fetches your SVGs in browser with `fetch` request. And caches of course. | ||
2. Puts it into [sprite](https://daily-dev-tips.com/posts/svg-sprites/) that is stored in your `body`. | ||
3. Provides you with the React component and standalone API to use this icon in your code. | ||
4. That's it. You now may use all the fancy css-styling like if it was inline svg. | ||
4. That's it. You now may use all the fancy css-styling like if it was inline SVG. | ||
@@ -17,3 +17,3 @@ ## Why | ||
2. Styling with css is a must-have, and this is the only way of getting it except for inlining. | ||
3. Inlining svgs with React might be painful (there is a [tool](https://react-svgr.com/) though), it also increases the bundle size and just doesn't feel right. | ||
3. Inlining SVGs with React might be painful (there is a [tool](https://react-svgr.com/) though), it also increases the bundle size and just doesn't feel right. | ||
@@ -42,3 +42,3 @@ ## Usage | ||
I assume here that you use `file-loader` for bundling your svg-files and get public url to svg file in `iconSrc`, like so: | ||
I assume here that you use `file-loader` for bundling your svg-files and get public url to SVG file in `iconSrc`, like so: | ||
```javascript | ||
@@ -60,3 +60,3 @@ module.exports = { | ||
But in fact there is no difference for the **handy-svg** where you get your svgs urls from. | ||
But in fact there is no difference for the **handy-svg** where you get your SVGs urls from. | ||
@@ -66,3 +66,3 @@ #### Standalone | ||
``` typescript | ||
```typescript | ||
import {injector} from 'handy-svg/lib/injector'; | ||
@@ -78,4 +78,4 @@ | ||
// Than you can use it at your will | ||
const svg = `<svg><use xlinkHref="#${id}" /></svg>`; | ||
// Then you can use it at your will | ||
const svg = `<svg><use href="#${id}" /></svg>`; | ||
``` | ||
@@ -82,0 +82,0 @@ |
15123