Skip to content

Instantly share code, notes, and snippets.

@negamaxi
Last active June 23, 2019 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save negamaxi/887d87f9d60d0719f0bfb5414205df50 to your computer and use it in GitHub Desktop.
Save negamaxi/887d87f9d60d0719f0bfb5414205df50 to your computer and use it in GitHub Desktop.
Create React App flow stubs
[options]
module.name_mapper.extension='module.css' -> 'CSSModule'
module.name_mapper.extension='svg' -> 'SVGModule'
module.system=haste
// flow-typed/global/css-module-stub.js
// @flow
type CSSModuleType = { [key: string]: string };
declare module "CSSModule" {
declare module.exports: CSSModuleType;
}
// flow-typed/global/svg-module-stub.js
// @flow
// TODO: create props type the right way
type SVGComponentPropsType = {|
className?: string
|};
type SVGComponentType = (props: SVGComponentPropsType) => React$Element<"svg">;
type SVGModuleType = {
ReactComponent: SVGComponentType
};
declare module "SVGModule" {
declare module.exports: SVGModuleType;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment