Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
fix(typescript): add React.ReactChild to CSSPropertiesLossy
Browse files Browse the repository at this point in the history
* docs(user): add Kais-DkM

* fix(typescript): add React.ReactChild to CSSPropertiesLossy
  • Loading branch information
remagpie authored and Kent C. Dodds committed Aug 27, 2017
1 parent cfc3360 commit 08cfb31
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
31 changes: 31 additions & 0 deletions test/glamorous.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -520,3 +520,34 @@ const usePropsAreCssOverrides = (
/>
</div>
)

const BuiltinSingleElement: JSX.Element = <glamorous.Div />;

const BuiltinSingleChild: JSX.Element = (
<glamorous.Div>
<glamorous.Span>Hello, world!</glamorous.Span>
</glamorous.Div>
);

const BuiltinMultipleChild: JSX.Element = (
<glamorous.Div>
<glamorous.Span>Hello,</glamorous.Span>
<glamorous.Span>world!</glamorous.Span>
</glamorous.Div>
);

const BuiltinStyledSingleElement: JSX.Element =
<glamorous.Div color='red'/>

const BuiltinStyledWithSingleChild: JSX.Element = (
<glamorous.Div color='red'>
<glamorous.Span>Hello, world!</glamorous.Span>
</glamorous.Div>
);

const BuiltinStyledWithMultipleChild: JSX.Element = (
<glamorous.Div color='red'>
<glamorous.Span>Hello,</glamorous.Span>
<glamorous.Span>world!</glamorous.Span>
</glamorous.Div>
);
1 change: 1 addition & 0 deletions typings/css-properties.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,7 @@ export interface CSSPropertiesLossy {
| string | number | CSSPropertiesComplete | undefined
| Array<CSSPropertiesComplete[keyof CSSPropertiesComplete]>
| CSSPropertiesLossy
| React.ReactChild
}

export interface CSSProperties extends
Expand Down
3 changes: 2 additions & 1 deletion typings/svg-properties.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface SVGPropertiesCompleteSingle {
target?: string;
type?: string;
width?: number | string;

// Other HTML properties supported by SVG elements in browsers
role?: string;
tabIndex?: number;
Expand Down Expand Up @@ -287,6 +287,7 @@ export interface SVGPropertiesLossy {
| string | number | SVGProperties | undefined
| Array<SVGPropertiesCompleteSingle[keyof SVGPropertiesCompleteSingle]>
| SVGPropertiesLossy
| React.ReactChild
}

export interface SVGProperties extends
Expand Down

0 comments on commit 08cfb31

Please sign in to comment.