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)
This commit is contained in:
Kaelig Deloumeau-Prigent
2017-10-22 05:38:18 +01:00
committed by John Reilly
parent 902a364510
commit ed36d5538f
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -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<ButtonProps, Button>;
@@ -2782,6 +2782,7 @@ declare namespace React {
}
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
as?: string;
href?: string;
hrefLang?: string;
integrity?: string;
+2 -1
View File
@@ -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<ButtonProps, Button>;
@@ -2720,6 +2720,7 @@ declare namespace React {
}
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
as?: string;
href?: string;
hrefLang?: string;
integrity?: string;