Commit Graph
33 Commits
Author SHA1 Message Date
Masahiro Wakame dc021df210 Merge pull request #3111 from hraban/patch-1
React.render() return value incorrect
2014-11-29 13:55:19 +09:00
Steve Baker c7d900175e add factory test 2014-11-13 20:25:46 +01:00
Steve Baker 64dcdb9702 add convenience overload to getDOMNode 2014-11-13 20:05:32 +01:00
Steve Baker fa6e45ea4c allow calling component or element functions no arguments 2014-11-13 18:30:05 +01:00
Hraban Luyat 82e42f3d53 React.render() return value incorrect
React.render does not return an element but a component. It's the `this` from the render callback:

> Instances of a React Component are created internally in React when rendering. These instances are reused in subsequent renders, and can be accessed in your component methods as this. The only way to get a handle to a React Component instance outside of React is by storing the return value of React.render. Inside other Components, you may use refs to achieve the same result.

http://facebook.github.io/react/docs/component-api.html

This particular pull request is probably not perfect (e.g. I don't know what to pass as the type parameter for state so I just set it to `void`). It does scratch my particular itch, though; calling `.setProps(..)` on the return value of `React.render(...)` is now possible.

Sorry if I misunderstood. By no means a react expert. Nor typescript, for that matter.

Cheers
2014-11-09 04:12:34 +01:00
Phips Peter 10a78d4323 Adding createElement
This is based off the work of @jnetterf in
https://github.com/Asana/typed-react/pull/24/files#diff-4
2014-10-22 17:11:22 -07:00
Phips Peter c4d3efb7f1 Fixing isValidClass and isValidElement
The terminology is confusing right now.
2014-10-17 16:51:08 -07:00
Phips Peter 17d211f896 Adding createFactory
Forgot about this piece but is important for removing warnings.
2014-10-17 16:42:11 -07:00
Phips Peter f547d80f49 Removed descriptors from our code 2014-10-17 16:24:11 -07:00
Phips Peter 51b6fad247 Adding the new Element types
https://gist.github.com/sebmarkbage/fcb1b6ab493b0c77d589
2014-10-17 13:22:14 -07:00
Phips Peter 8b6079cfcd Removing transferPropsTo 2014-10-17 12:29:45 -07:00
Phips Peter d908e8f3bf Renaming based on the new React API
http://facebook.github.io/react/blog/2014/10/16/react-v0.12-rc1.html#renamed-apis
2014-10-17 12:26:28 -07:00
Phips Peter 8336da666d Renaming the legacy module for tests
Apparently they conflict otherwise which is unfortunate.
2014-10-17 12:14:42 -07:00
Phips Peter 1d663ab9a3 Moving React 0.11 into legacy
I'm following the example from Angular.
2014-10-17 12:09:56 -07:00
Phips Peter 0259c7fba1 Adding ReactAttributes
These were missing before
2014-10-03 11:49:52 -07:00
Phips Peter 596ab8e1ee Fixing renderComponent
It should return a descriptor, not be void.
2014-10-03 10:25:49 -07:00
Austen Talbot c01768cc27 Added type definitions for react-addons 2014-10-01 18:38:22 -07:00
Phips Peter bf5cd4b9b1 Starting react-addons module
We will use module merging to merge addons into the existing react
context.
2014-10-01 14:19:40 -07:00
Josh Smith e3382e45a7 Simple Test Components 2014-09-24 11:37:57 -07:00
Phips Peter 97f591c7df Reformatting for style changes with IntelliJ
Just want to uphold good style.
2014-09-24 11:15:28 -07:00
Phips Peter 46997c99af Adding SvgAttributes
Unfortunately SvgAttributes require union types and cannot be properly
typed.
2014-09-24 11:09:21 -07:00
Phips Peter e8c13a940c Cleaning up the attribute interfaces 2014-09-24 11:01:33 -07:00
Josh Smith bcaf3664e4 Add support for DomAttributes and DomElements 2014-09-23 19:53:27 -07:00
Phips Peter 7be64cc455 Renaming back to event attributes 2014-09-23 17:01:50 -07:00
Phips Peter 5febe1f3e6 Starting SVG Elements 2014-09-23 16:11:42 -07:00
Phips Peter 236a885f67 Fixing the tests 2014-09-23 16:04:18 -07:00
Phips Peter c5c3575304 Added support for refs 2014-09-23 15:49:25 -07:00
Phips Peter 26962dec65 Got props types to work 2014-09-23 15:47:06 -07:00
Phips Peter ea3c4f1200 Adding PropTypes 2014-09-23 15:28:22 -07:00
Phips Peter 713bb80881 Adding children 2014-09-23 15:14:13 -07:00
Phips Peter 0827cbdbab Adding touch events 2014-09-23 15:08:56 -07:00
Phips Peter 18695fafca Adding type declarations for components 2014-09-23 15:07:56 -07:00
Phips Peter 4bed0b571c Adding the initial types for React
Currently we just support the events
2014-09-15 22:13:43 -07:00