Skip to content
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

fix react-native-svg TS typedefs #3285

Merged
merged 1 commit into from
Jan 22, 2019
Merged

fix react-native-svg TS typedefs #3285

merged 1 commit into from
Jan 22, 2019

Conversation

slorber
Copy link
Contributor

@slorber slorber commented Jan 22, 2019

Why

I get TS errors when using new SDK32 TS, while it was not the case with @types/expo 31 from community

image

How

I did a cast to add the required TS defs to the Svg module. Maybe there's a more elegant solution but I'm not a TS expert and this seems to work fine

Test Plan

Generated the new TS defs on my expo work and copied them to my local app expo install to see if it works fine and it does.

The new TS defs are what I was looking for:

import * as SvgModules from 'react-native-svg';
import { ComponentClass } from 'react';
declare const _default: ComponentClass<SvgModules.SvgProps, any> & Pick<typeof SvgModules, "Circle" | "ClipPath" | "Defs" | "Ellipse" | "G" | "Image" | "Line" | "LinearGradient" | "Path" | "Pattern" | "Polygon" | "Polyline" | "RadialGradient" | "Rect" | "Stop" | "Symbol" | "TSpan" | "Text" | "TextPath" | "Use" | "EMaskUnits" | "Mask">;
export default _default;

Before:

image

After:

image

@sjchmiela sjchmiela requested a review from ide January 22, 2019 17:17
@ide ide merged commit 024f100 into expo:master Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants