Socket
Socket
Sign inDemoInstall

@fortawesome/react-fontawesome

Package Overview
Dependencies
9
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0-1 to 0.1.0-2

3

index.js

@@ -518,3 +518,2 @@ (function (global, factory) {

var convertCurry = convert.bind(null, React.createElement);
var extraProps = {};

@@ -576,2 +575,4 @@

var convertCurry = convert.bind(null, React.createElement);
fontawesome.noAuto();

@@ -578,0 +579,0 @@

{
"name": "@fortawesome/react-fontawesome",
"description": "Official React component for Font Awesome 5",
"version": "0.1.0-1",
"version": "0.1.0-2",
"main": "index.js",

@@ -51,5 +51,5 @@ "types": "index.d.ts",

"files": [
"index.js",
"index.d.ts"
"./index.js",
"./index.d.ts"
]
}

@@ -354,1 +354,55 @@ # react-fontawesome

```
### TypeScript
Typings are included in this package. However, most types are defined in the
underlying API library, <span style="whitespace:nowrap;">`@fortawesome/fontawesome`</span>.
Suppose that in one module, you add all `fas` icons to the library:
```
import { library } from '@fortawesome/fontawesome'
import { fas } from '@fortawesome/fontawesome-free-solid'
library.add(fas)
// ...
```
Then suppose that in another module, you have some code that looks up
one of the icons in the library. The `import` statement below imports two types
and one function:
```
import { IconLookup, IconDefinition, findIconDefinition } from '@fortawesome/fontawesome'
const coffeeLookup: IconLookup = { prefix: 'fas', iconName: 'coffee' }
const coffeeIconDefinition: IconDefinition = findIconDefinition(coffeeLookup)
// ...
export class App extends React.Component {
render() {
return (
<div className="App">
<h1>
<FontAwesomeIcon icon={coffeeIconDefinition} />
</h1>
</div>
);
}
}
```
NOTE: You wouldn't normally declare intermediate objects like `coffeeLookup`
just to look up an icon. So this is cumbersome and needlessly verbose for
such a simple example. The purpose here is just to show how you might
import type definitions and use them in declarations when it _does_ make
sense to do so.
Several types, including `IconLookup` and `IconDefinition`, appearing above,
actually originate from the
<span style="whitespace:nowrap;">`@fortawesome/fontawesome-common-types`</span>
package. They are re-exported from both <span style="whitespace:nowrap;">`@fortawesome/fontawesome`</span>
and <span style="whitespace:nowrap;">`@fortawesome/fontawesome-free-solid`</span>
(and other icon packs). This is just to make importing more convenient in
some cases.
Refer to the `index.d.ts` in any module to see which types it exports.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc