New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: FontAwesomeIcon: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. #170
Comments
For anyone else experiencing this issue, here is the patch (using patch-package) until this gets merged.
|
Here's the component translated to typescript, also gets rid of https://gist.github.com/eduardinni/3208a4c8159f689950ec9995a04097c8 |
@eduardinni I made a simpler solution import React from 'react'
import {
FontAwesomeIcon as FontAwesomeIconPatched,
type Props as FontAwesomeIconProps,
} from "@fortawesome/react-native-fontawesome";
// @ts-expect-error remove defaultProps
FontAwesomeIconPatched.defaultProps = undefined;
export function FontAwesomeIcon(props: FontAwesomeIconProps) {
const style = props.style ?? {}
return <FontAwesomeIconPatched {...props} style={style} />;
} |
I've released 0.3.1 which should address this issue. If anyone finds a problem just let me know. |
Describe the bug
When building with React Native 0.74.0, I get the following error on use of
<FontAwesomeIcon>
Reproducible test case
Include a URL (codepen.io, jsfiddle.net, Git repository, codesandbox.io, stackblitz.com, etc.) that demonstrates the problem.
Expected behavior
No warnings generated
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: