Skip to content

Typescript support #79

Open
Open

Description

@brenwell

Hey there, thanks for the lib!

I noticed there were no typings for this lib. I am new to Typescript so i can't really create them myself. I have started but I am not sure how to import the proptypes and extend from TouchableOpacity

If anyone can help that would be great

import { Component } from "react";

export = Button;

type ButtonProps = {
    allowFontScaling?: boolean;
    accessibilityLabel?: string;
    containerStyle?: object;
    disabledContainerStyle?: object;
    disabled?: boolean;
    style?: object;
    styleDisabled?: object;
    childGroupStyle?: object;
}

/*~ Write your module's methods and properties in this class */
declare class Button<P = {}, S = {}> extends Component<ButtonProps, S> {
    constructor(props: object);
}

Activity

  1. jsina commented on Jul 3, 2019

    @jsina

    for temporary resolving you could follow this rules:

    • add typings.d.ts under the root folder with this code:

    declare module 'react-native-button';

  2. shubhamkakkar commented on Jul 15, 2019

    @shubhamkakkar

    Hey, I am planning to add a PR for the typescript support.
    Any prort information is appreaciated.
    besides this I am also working on issue #82

  3. neekers commented on Mar 25, 2020

    @neekers

    Any update on this?

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions