Add some attributes tests to react-tests and remove index signature from React.CSSProperties

This commit is contained in:
Vincent Siao
2014-12-08 14:55:10 -08:00
parent cc25144fde
commit b4174b1ff1
2 changed files with 25 additions and 3 deletions
+24
View File
@@ -115,6 +115,30 @@ var value: string = inputRef.getDOMNode<HTMLInputElement>().value;
var myComponent = <MyComponent>compComponent;
myComponent.reset();
//
// Attributes
// --------------------------------------------------------------------------
var divStyle = { // CSSProperties
flex: "1 1 main-size",
backgroundImage: "url('hello.png')"
};
var htmlAttr = {
children: ["Hello world", [null], React.DOM.span(null)],
className: "test-attr",
style: divStyle,
onClick: (event: React.MouseEvent) => {
event.preventDefault();
event.stopPropagation();
},
dangerouslySetInnerHTML: {
__html: "<strong>STRONG</strong>"
}
};
React.DOM.div(htmlAttr);
React.DOM.span(htmlAttr);
React.DOM.input(htmlAttr);
//
// PropTypes
// --------------------------------------------------------------------------
+1 -3
View File
@@ -285,7 +285,7 @@ declare module React {
interface CSSProperties {
columnCount?: number;
flex?: number;
flex?: any; // number | string
flexGrow?: number;
flexShrink?: number;
fontWeight?: number;
@@ -301,8 +301,6 @@ declare module React {
// SVG-related properties
fillOpacity?: number;
strokeOpacity?: number;
[key: string]: any; // number | string
}
interface HTMLAttributes extends ReactAttributes {