Skip to content

Commit

Permalink
fix: correct Chip component typings (callstack#1044)
Browse files Browse the repository at this point in the history
As of version 2.15.2 the Chip component accepts the prop `selectedColor`
which it defines as an optional string prop. Though this change was
introduced to the Chip component itself, the typings for the component
were not updated which causes Typescript to complain when using the
`selectedColor` prop. This change adds the missing type to appease
Typescript.
  • Loading branch information
mikestone14 authored and iyadthayyil committed Jun 6, 2019
1 parent 61fd4b5 commit 56ba9bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion __ts-tests__/Chip.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import { Chip } from '..';

const MyComponent = () => (
<Chip icon="info" onPress={() => console.log('Pressed')}>Example Chip</Chip>
<Chip icon="info" selectedColor="#fff" onPress={() => console.log('Pressed')}>Example Chip</Chip>
);

export default MyComponent;
1 change: 1 addition & 0 deletions typings/components/Chip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface ChipProps {
icon?: IconSource;
avatar?: React.ReactNode;
selected?: boolean;
selectedColor?: string;
disabled?: boolean;
accessibilityLabel?: string;
onPress?: () => any;
Expand Down

0 comments on commit 56ba9bc

Please sign in to comment.