Skip to content

SwitchProps interface is not exported #57

@claudvanbarret

Description

@claudvanbarret

I'm styling switch with styled-components in TypeScript like this:

import styled from "styled-components";
import Switch from "rc-switch";

export const StyledSwitch = styled(Switch)(({ checked, disabled }) => {
  position: "relative",
  borderRadius: "1rem",
  cursor: "pointer",
});

But I'm getting this error.

Exported variable 'StyledSwitch' has or is using name 'SwitchProps' from external module "/Users/claudvanbarret/project/node_modules/rc-switch/lib/index" but cannot be named.ts(4023)

This error can be probably is an issue in TypeScript, but wen can quickly solve this problem by exporting the SwitchProps interface.

I already send a pull request(#56) to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions