Skip to content

version 12.4.1 SvgCssUri component with width prop has a Type error #1811

Description

@zhiqingchen

Question

SvgCssUri component has a Type error when i add width or height prop.
The following code is from USAGE.

import * as React from 'react';
import { SvgCssUri } from 'react-native-svg';

export default () => (
  <SvgCssUri
    width="100%"
    height="100%"
    uri="http://thenewcode.com/assets/svg/accessibility.svg"
  />
);

Type error

“Type '{ uri: string; width: string; height: string; }' is not assignable to type '“IntrinsicAttributes & { uri: string | null; } & AdditionalProps”'.ts(2322)

Type declare from source code

export declare function SvgCssUri(props: UriProps): JSX.Element;


export declare type UriProps = {
    uri: string | null;
} & AdditionalProps;

export declare type AdditionalProps = {
    onError?: (error: Error) => void;
    override?: Object;
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions