mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Merge pull request #30046 from Igorbek/dt-issue30042
[styled-components] Fix #30042
This commit is contained in:
commit
33937378a6
2
types/styled-components/index.d.ts
vendored
2
types/styled-components/index.d.ts
vendored
@ -82,7 +82,7 @@ export interface ThemedStyledFunction<P, T, O = P> {
|
||||
strings: TemplateStringsArray,
|
||||
...interpolations: Array<Interpolation<ThemedStyledProps<P & U, T>>>
|
||||
): StyledComponentClass<P & U, T, O & U>;
|
||||
attrs<U, A extends Partial<P & U> = {}>(
|
||||
attrs<U, A extends Partial<P & U> & { [others: string]: any; } = {}>(
|
||||
attrs: Attrs<P & U, A, T>,
|
||||
): ThemedStyledFunction<DiffBetween<A, P & U>, T, DiffBetween<A, O & U>>;
|
||||
}
|
||||
|
||||
@ -312,6 +312,12 @@ const AttrsInput = styled.input.attrs({
|
||||
padding: ${props => props.padding};
|
||||
`;
|
||||
|
||||
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30042
|
||||
const AttrsWithOnlyNewProps = styled.h2.attrs({ as: 'h1' })`
|
||||
color: ${props => props.as === 'h1' ? 'red' : 'blue'};
|
||||
font-size: ${props => props.as === 'h1' ? 2 : 1};
|
||||
`;
|
||||
|
||||
/**
|
||||
* component type
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user