From e4c860c1baaf995f63bcf99c66d0c2b297aff2eb Mon Sep 17 00:00:00 2001 From: Wayne Dela Cruz Date: Mon, 17 Apr 2017 23:34:07 +0800 Subject: [PATCH] React specific typings for css position (#15575) * React CSSProperties position made specific * Add test for css position --- types/react/index.d.ts | 2 +- types/react/test/cssProperties.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 3d81626535..fbcfc451de 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -1599,7 +1599,7 @@ declare namespace React { /** * The position property controls the type of positioning used by an element within its parent elements. The effect of the position property depends on a lot of factors, for example the position property of parent elements. */ - position?: CSSWideKeyword | any; + position?: CSSWideKeyword | "static" | "relative" | "absolute" | "fixed" | "sticky"; /** * Obsolete: unsupported. diff --git a/types/react/test/cssProperties.tsx b/types/react/test/cssProperties.tsx index a453589f23..7447d1eb52 100644 --- a/types/react/test/cssProperties.tsx +++ b/types/react/test/cssProperties.tsx @@ -30,6 +30,9 @@ const boxShadowStyleTest =
; const overflowStyle: React.CSSProperties = { overflow: 'auto', overflowX: 'visible', overflowY: 'scroll' }; const overflowStyleTest =
; +const positionStyle: React.CSSProperties = { position: 'relative' }; +const positionStyleTest =
; + // SVG specific style attribute declarations const fillOpacityStyle: React.CSSProperties = { fillOpacity: 0.3 };