mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 15:00:26 +00:00
Merge pull request #30046 from Igorbek/dt-issue30042
[styled-components] Fix #30042
This commit is contained in:
Vendored
+1
-1
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user