@fortawesome/react-fontawesome
Advanced tools
Comparing version 0.1.19 to 0.2.0
/// <reference types="react" /> | ||
import { CSSProperties, SVGAttributes } from 'react' | ||
import { CSSProperties, SVGAttributes, RefAttributes } from 'react' | ||
import { | ||
@@ -23,4 +23,3 @@ Transform, | ||
export interface FontAwesomeIconProps extends BackwardCompatibleOmit<SVGAttributes<SVGSVGElement>, 'children' | 'mask' | 'transform'> { | ||
forwardedRef?: ((e: any) => void) | React.MutableRefObject<any> | null | ||
export interface FontAwesomeIconProps extends BackwardCompatibleOmit<SVGAttributes<SVGSVGElement>, 'children' | 'mask' | 'transform'>, RefAttributes<SVGSVGElement> { | ||
icon: IconProp | ||
@@ -27,0 +26,0 @@ mask?: IconProp |
@@ -199,3 +199,3 @@ import { parse, icon } from '@fortawesome/fontawesome-svg-core'; | ||
var _excluded$1 = ["style"]; | ||
var _excluded = ["style"]; | ||
@@ -261,3 +261,3 @@ function capitalize(val) { | ||
existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style, | ||
remaining = _objectWithoutProperties(extraProps, _excluded$1); | ||
remaining = _objectWithoutProperties(extraProps, _excluded); | ||
@@ -334,7 +334,3 @@ mixins.attrs['style'] = _objectSpread2(_objectSpread2({}, mixins.attrs['style']), existingStyle); | ||
var _excluded = ["forwardedRef"]; | ||
function FontAwesomeIcon(_ref) { | ||
var forwardedRef = _ref.forwardedRef, | ||
props = _objectWithoutProperties(_ref, _excluded); | ||
var FontAwesomeIcon = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var iconArgs = props.icon, | ||
@@ -365,3 +361,3 @@ maskArgs = props.mask, | ||
var extraProps = { | ||
ref: forwardedRef | ||
ref: ref | ||
}; | ||
@@ -375,3 +371,3 @@ Object.keys(props).forEach(function (key) { | ||
return convertCurry(abstract[0], extraProps); | ||
} | ||
}); | ||
FontAwesomeIcon.displayName = 'FontAwesomeIcon'; | ||
@@ -378,0 +374,0 @@ FontAwesomeIcon.propTypes = { |
14
index.js
@@ -206,3 +206,3 @@ (function (global, factory) { | ||
var _excluded$1 = ["style"]; | ||
var _excluded = ["style"]; | ||
@@ -268,3 +268,3 @@ function capitalize(val) { | ||
existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style, | ||
remaining = _objectWithoutProperties(extraProps, _excluded$1); | ||
remaining = _objectWithoutProperties(extraProps, _excluded); | ||
@@ -341,7 +341,3 @@ mixins.attrs['style'] = _objectSpread2(_objectSpread2({}, mixins.attrs['style']), existingStyle); | ||
var _excluded = ["forwardedRef"]; | ||
function FontAwesomeIcon(_ref) { | ||
var forwardedRef = _ref.forwardedRef, | ||
props = _objectWithoutProperties(_ref, _excluded); | ||
var FontAwesomeIcon = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) { | ||
var iconArgs = props.icon, | ||
@@ -372,3 +368,3 @@ maskArgs = props.mask, | ||
var extraProps = { | ||
ref: forwardedRef | ||
ref: ref | ||
}; | ||
@@ -382,3 +378,3 @@ Object.keys(props).forEach(function (key) { | ||
return convertCurry(abstract[0], extraProps); | ||
} | ||
}); | ||
FontAwesomeIcon.displayName = 'FontAwesomeIcon'; | ||
@@ -385,0 +381,0 @@ FontAwesomeIcon.propTypes = { |
{ | ||
"name": "@fortawesome/react-fontawesome", | ||
"description": "Official React component for Font Awesome 5", | ||
"version": "0.1.19", | ||
"version": "0.2.0", | ||
"main": "index.js", | ||
@@ -29,3 +29,4 @@ "module": "index.es.js", | ||
"Tiago Sousa <github.com/TiagoPortfolio>", | ||
"Alexey Victorov <github.com/AliMamed>" | ||
"Alexey Victorov <github.com/AliMamed>", | ||
"Calum Smith <github.com/cpmsmith>" | ||
], | ||
@@ -52,3 +53,3 @@ "license": "MIT", | ||
"@fortawesome/fontawesome-svg-core": "~1 || ~6", | ||
"react": ">=16.x" | ||
"react": ">=16.3" | ||
}, | ||
@@ -55,0 +56,0 @@ "devDependencies": { |
@@ -22,2 +22,10 @@ <a href="https://fontawesome.com"> | ||
`react-fontawesome` now supports `forwardRef` for version `0.2.x` or above. This was a breaking change so if you are using React older than version 16.3.0 choose the `0.1.x` version of this component. | ||
## Compatibility | ||
| React version | react-fontawesome version | | ||
| - | - | | ||
| < 16.3.0 | 0.1.x | | ||
| >= 16.3.0 | 0.2.x | | ||
Official documentation is hosted at fontawesome.com: | ||
@@ -58,2 +66,3 @@ | ||
| Alexey Victorov | [@AliMamed](https://github.com/AliMamed) | | ||
| Calum Smith | [@cpmsmith](https://github.com/cpmsmith) | | ||
| Font Awesome Team | [@FortAwesome](https://github.com/orgs/FortAwesome/people)| | ||
@@ -60,0 +69,0 @@ |
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
37353
73
774