Skip to content

Commit

Permalink
Fix flow types errors
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-cerutti committed Apr 9, 2021
1 parent 3c64d51 commit d6523ad
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ inexact-spread =off

[options]
include_warnings=false
module.ignore_non_literal_requires=true

[strict]

Expand Down
38 changes: 38 additions & 0 deletions flow-typed/npm/@fortawesome/react-fontawesome_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// flow-typed signature: 5e5e8d18bbe114401d1bb40fadcf8c21
// flow-typed version: <<STUB>>/@fortawesome/react-fontawesome_v^0.1.14/flow_v0.107.0

/**
* This is an autogenerated libdef stub for:
*
* '@fortawesome/react-fontawesome'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/

declare module '@fortawesome/react-fontawesome' {
declare module.exports: any;
}

/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module '@fortawesome/react-fontawesome/index.es' {
declare module.exports: any;
}

// Filename aliases
declare module '@fortawesome/react-fontawesome/index.es.js' {
declare module.exports: $Exports<'@fortawesome/react-fontawesome/index.es'>;
}
declare module '@fortawesome/react-fontawesome/index' {
declare module.exports: $Exports<'@fortawesome/react-fontawesome'>;
}
declare module '@fortawesome/react-fontawesome/index.js' {
declare module.exports: $Exports<'@fortawesome/react-fontawesome'>;
}
2 changes: 1 addition & 1 deletion src/lib/components/icon/Icon.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function getLazyStyledIcon(iconInfo) {
const icon = await import(`@fortawesome/${fontAwesomeType}/${iconClass}.js`);
return { default: ({ color, size, ...rest }) => <IconStyled color={ color } icon={ icon[iconClass] } size={ size } { ...rest } /> }
} catch {
return null;
return { default: () => <Loader size="base" /> };
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion stories/icon.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import React from 'react';
import Icon, { iconTable as iconTable } from "../src/lib/components/icon/Icon.component";
import Icon, { iconTable } from "../src/lib/components/icon/Icon.component";
import { Wrapper, Title } from './common';

export default {
Expand Down

0 comments on commit d6523ad

Please sign in to comment.