Commit Graph
93 Commits
Author SHA1 Message Date
Paul ColleoniandAndy 1cf7a72cb6 [react] added backgroundSize to the CSSProperties (#20862) 2017-10-30 08:04:35 -07:00
Paulo CesarandJohn Reilly 10612bcf84 Update index.d.ts (#20811)
remove duplicated `as`
2017-10-22 15:39:35 +01:00
Kaelig Deloumeau-PrigentandJohn Reilly ed36d5538f 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)
2017-10-22 05:38:18 +01:00
Artem MalkoandJohn Reilly 38e3db12b8 react Add 'as' attribute for link element (#20769) 2017-10-20 19:36:49 +01:00
Josh RutherfordandJohn Reilly 1fb244abed react-dom: add createPortal API (#20245). (#20336)
* react-dom: add createPortal API.

* React, React-DOM: move portal interface to types/react, update render for class components to include ReactPortal.

* react-dom: add second portal test case with jsx, allow jsx in react-dom-tests.

* react, react-dom createPortal api: remove undocumented arguments, properties.
2017-10-19 11:40:47 +01:00
Richard JedličkaandAndy f487a1c111 [react] Fix isValidElement to accept any type (#20641)
* [react] Fix `isValidElement` to accept `any` type

* [react] Fix `isValidElement` method param type

Change `object` parameter type from `any` to more explicit.
2017-10-17 11:58:39 -07:00
John GozdeandAndy bbf3e9cb0b [react]: Remove deprecated+removed APIs (#20409)
* create-react-class: add definitions

* react-dom-factories: add definitions

* create-react-class: add tests, fix errors

* react-dom-factories: add tests, fix lint

* react: remove previously deprecated APIs

* Remove deprecated usages in other definitions

* redux-form: disable strictFunctionTypes

Changes to react typings revealed errors in redux-form that are present
in 'master'. This needs to be handled separately.

* Update create-react-class, react-dom-factories author

* Avoid importing create-react-class where possible

* Move top-level createReactClass tests to create-react-class
2017-10-16 15:22:04 -07:00
Rasmus EnemanandAndy f92fedd919 @types/react: Add documentation to confusing event properties (#20595)
These properties can be non-obvious and some doc comments could be helpful
2017-10-16 15:09:26 -07:00
Benoit VandAndy 016a82b4eb Update index.d.ts (#20499)
Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
Broken by: https://github.com/DefinitelyTyped/DefinitelyTyped/commit/a24aee6125213ba20a5bda15a5d4fce8b60b2f57
React documentation for the supported "type" attribute: https://reactjs.org/docs/dom-elements.html
2017-10-16 13:19:44 -07:00
Nicu MicleușanuandAndy 3d41a7ce59 react: Add support for more SVG elements (#19871) 2017-10-16 09:03:27 -07:00
AndyandGitHub 947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
cynecxandJohn Reilly 0b21b7dd63 [react] [react-dom] Add support for rendering an array of elements (#19363)
* Test

* Fix react typings

* Revert "Use []-syntax for some cases."

This reverts commit 5f6e55843980b2cff9ace4174f72b4f8aa7ad278.

* Modify another render function's return type

* Use Array<T> instead in react.d.ts & Fix issues with the typescript linter & Adapt changes in react-router

* Convert Array<T> to T[]

* Add support for string and number return types.
2017-10-06 19:08:29 +01:00
Nathan Shively-Sanders ba5a8c2243 Merge branch 'master' into fix-for-strictFunctionTypes 2017-10-03 13:05:23 -07:00
StevenandRyan Cavanaugh e54b30fafc react-dom: Upgrade to v16.0.0 (#20065)
* Add hydrate method

* Add hydrate to react-dom-tests.ts

* Fix whitespace

* Create shared interface for `render` and `hydrate`

* Add renderToNodeStream and renderToStaticNodeStream methods in ReactDomServer

* Add proper nodejs.readablestream

* Add react-dom v15 for backwards compatibility

* Add proper baseUrl for react-dom/v15

* Change react test _interval type to NodeJS.Timer

* Export the renderer interface

* Change react/v15 to use NodeJS.Timer
2017-10-02 16:08:01 -07:00
Nathan Shively-Sanders b8ea87c68e Strict function variance fixes round 1 2017-10-02 15:50:34 -07:00
Andrew GoodaleandRyan Cavanaugh 2233a0eee6 Allow projects to use React declarations without the DOM lib dependency. (#20005) 2017-10-02 15:06:51 -07:00
Matt MartinandMohamed Hegazy 76948bcf31 minor: add "playsinline" attribute to <video/> (#19530)
* adding optional 'playsinline' attribute to HTML5 video tag

* also adding playsinline to v15
2017-09-25 13:50:05 -07:00
York YaoandMasahiro Wakame 29ca22c8b0 [React] change createElement declaration (#19858)
* fix https://github.com/Microsoft/TypeScript/issues/15019

* change the stable v15 declaration too

* catch-all case also take string

* add string for test
2017-09-26 01:14:17 +09:00
AndyandGitHub cb2dbfbb50 Add ignores for new lint rules (#19504) 2017-09-01 07:47:52 -07:00
AndyandGitHub d38fdb9146 react/v15: Fix compile error (#19281)
* react/v15: Fix compile error

* Fix lint
2017-08-23 13:26:55 -07:00
AndyandGitHub 31bdc690b3 react: Improve types for "input" (#19240) 2017-08-22 10:11:56 -07:00
AndyandJohn Reilly cf0172024a react: Fix compile error (#19210)
* react: Fix compile error

* Better fix: Use InputHTMLAttributes

* Use a separte overload just for "input"
2017-08-22 06:06:49 +01:00
AndyandGitHub 924fafffc0 Fix remaining lint errors (#19166) 2017-08-20 15:37:53 -07:00
AndyandGitHub 5d6c651a1a Apply stricter lint rules (#19063) 2017-08-17 14:53:41 -07:00
Stéphane GoetzandMohamed Hegazy f6e30f1669 Add scope?: string to Td HTML attributes (#18381)
This attribute exists on both <th> and <td> but is present only in <th> currently: https://www.w3schools.com/tags/att_td_scope.asp
2017-08-08 14:43:27 -07:00
Rich SevioraandSheetal Nandi 27510572ea React - Adding ComponentLifecycle Documentation (#18642)
Add an optional extended description…
2017-08-04 16:26:12 -07:00
Rich SevioraandSheetal Nandi 178dd15e5e Update for React 16 (#18463) 2017-07-31 14:58:27 -07:00
Dovydas NavickasandGitHub 1990f71c1f Update index.d.ts 2017-07-27 23:33:01 +03:00
Dovydas NavickasandGitHub 0139a27de7 Update index.d.ts 2017-07-27 23:16:38 +03:00
Dovydas NavickasandGitHub d10fdbcc3e Reverted #18227 2017-07-25 13:01:34 +03:00
Mike Deverell c3f41ac81b 'autoComplete' should be lowercase 'autocomplete' 2017-07-22 22:32:57 -04:00
Mike Deverell 801ffc3751 add myself (devrelm) to the contributors list 2017-07-22 22:32:57 -04:00
Mike Deverell d9420c7ffc add missing textarea attributes 2017-07-22 22:32:57 -04:00
sboehler 4fd96da0fe Fix value prop in select element 2017-07-11 17:45:49 +02:00
Stéphane Goetz a24aee6125 Improve react typings for HTML attributes, fix tests in other libraries 2017-07-10 22:43:07 +02:00
Ryan CavanaughandGitHub fec422d226 Merge pull request #17611 from tkrotoff/react-router-component
Refactoring: use React.ComponentType
2017-07-10 09:41:41 -07:00
Nathan Shively-Sanders cc271b097d Merge branch 'master' into improve-react-domelement-type-parameter 2017-07-06 09:37:55 -07:00
Dovydas Navickas 929b4a206d Fixes for comments. 2017-06-29 20:57:10 +03:00
Dovydas Navickas 429ff58c9e Added string fallback for type in ReactElement and DOMElement. This is needed for cusotm web-comonents. 2017-06-29 19:28:46 +03:00
Dovydas Navickas da4a5b2bc7 Merge branch 'patch-5' of https://github.com/DovydasNavickas/DefinitelyTyped into patch-5 2017-06-29 19:26:02 +03:00
Dovydas Navickas 0af3e88ce6 Added React.createElement overload for DOMElement. 2017-06-29 18:29:24 +03:00
Dovydas NavickasandGitHub 05b4b728e3 Merge branch 'master' into patch-5 2017-06-29 18:20:29 +03:00
Dovydas Navickas fc3bbed6db React.cloneElement overloads for ReactHTMLElement and SVGElement added. 2017-06-29 17:44:15 +03:00
Dovydas Navickas d3901d1290 Tslint disabling updated to disable only one line. 2017-06-29 15:28:23 +03:00
Tanguy Krotoff 5addbe9b72 React.ComponentType<P> => React.ComponentType<P = {}> 2017-06-29 14:00:19 +02:00
Dovydas Navickas e94d1c1c03 React tslint errors fixed. 2017-06-29 14:43:22 +03:00
Nathan Shively-Sanders 15b7bac319 Add a string-fallback overload to React.createElement
The types aren't quite as nice as when providing a string literal like
"div" or "input", but it works as well as it did before the
string-literal-overload change in #17507.
2017-06-28 15:00:56 -07:00
Nathan Shively-Sanders 0d61b71678 Improve React.DOMElement type parameter for 2.4 weak type checks
DOMAttributes, HTMLAttributes and SVGAttributes are all weak types.
In React.DOMElement, people always pass either HTMLAttributes or
SVGAttributes, so the type parameter is just constrained to
DOMAttributes. This is not as good as a union of (HTML | SVGAttrs) for 2
reasons:

1. Valid HTMLAttributes objects that don't include some DOMAttributes
properties fail TS 2.4's weak type check.
2. Invalid HTMLAttributes objects don't get type checking for
HTMLAttributes properties.

For example:

```ts
var e: React.DOMElement<{
  style: {
    checked: "no"
  }
}, Element>;
```

But `checked` is actually a boolean. Previously, this was not an error.
2017-06-28 09:39:36 -07:00
Dovydas Navickas 9e62632e24 Added tslint.json for react. 2017-06-28 15:03:32 +03:00
Jacob RaskandGitHub c7fcc11729 Remove references to removed section in React README
setState issues were removed.
2017-06-28 13:32:59 +02:00