From ed36d5538fe4656f9cf79e9c481d2102fc6e7bc6 Mon Sep 17 00:00:00 2001 From: Kaelig Deloumeau-Prigent Date: Sat, 21 Oct 2017 21:38:18 -0700 Subject: [PATCH] react: Add "as" attribute to link elements (#20628) * Add "as" attribute to links See corresponding addition here: https://github.com/facebook/react/pull/7582 * Add "as" attribute to link elements in React v16 definition * Turn commas into semicolons (React 15) * Turn commas into semicolons (React 16) --- types/react/index.d.ts | 3 ++- types/react/v15/index.d.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index f79caad296..ee3f9616ac 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -33,7 +33,7 @@ And since any object is assignable to {}, we would lose the type safety of the P Therefore, the type of props is left as Q, which should work for most cases. If you need to call cloneElement with key or ref, you'll need a type cast: interface ButtonProps { - label: string, + label: string; isDisabled?: boolean; } var element: React.CElement; @@ -2782,6 +2782,7 @@ declare namespace React { } interface LinkHTMLAttributes extends HTMLAttributes { + as?: string; href?: string; hrefLang?: string; integrity?: string; diff --git a/types/react/v15/index.d.ts b/types/react/v15/index.d.ts index 6be40c0f6b..c35e2df3c0 100644 --- a/types/react/v15/index.d.ts +++ b/types/react/v15/index.d.ts @@ -35,7 +35,7 @@ Therefore, the type of props is left as Q, which should work for most cases. If you need to call cloneElement with key or ref, you'll need a type cast: interface ButtonProps { - label: string, + label: string; isDisabled?: boolean; } var element: React.CElement; @@ -2720,6 +2720,7 @@ declare namespace React { } interface LinkHTMLAttributes extends HTMLAttributes { + as?: string; href?: string; hrefLang?: string; integrity?: string;