From 660d2635653956dc99125e94f18455d8330d2c46 Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Fri, 12 Dec 2014 16:10:24 -0800 Subject: [PATCH] Change React.React.Attributes.key type to any // number | string --- react/react-tests.ts | 6 +++++- react/react.d.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/react/react-tests.ts b/react/react-tests.ts index ac7ca85fd..338e483a0 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -18,6 +18,8 @@ interface MyComponent extends React.CompositeComponent { } var props: Props = { + key: 42, + ref: "myComponent42", hello: "world", foo: 42, bar: true @@ -124,7 +126,9 @@ var divStyle = { // CSSProperties flex: "1 1 main-size", backgroundImage: "url('hello.png')" }; -var htmlAttr = { +var htmlAttr: React.HTMLAttributes = { + key: 36, + ref: "htmlComponent", children: children, className: "test-attr", style: divStyle, diff --git a/react/react.d.ts b/react/react.d.ts index ca94c7e01..2b75bb3fd 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -242,7 +242,7 @@ declare module React { export interface ReactAttributes { children?: any; // ReactNode - key?: string; + key?: any; // number | string ref?: string; // Event Attributes