@@ -37,15 +37,17 @@ const serialize = require('./utilities/serialize');
37
37
*
38
38
* This has a very symmetrical relationship to the userland side of creating a
39
39
* React Component. There are the additional private methods used by other parts
40
- * of React Core, such as `getPublicInstance` or `getNativeNode`.
40
+ * of React Core, such as `getPublicInstance` or
41
+ * React <= 15.0 `getNativeNode`
42
+ * React > 15.0 `getHostNode`
41
43
*/
42
44
const MinimumViableComponent = function ( element ) {
43
45
// This internal API—while relatively unchanged for a while—is likely pretty
44
46
// volatile. Many of these names began with ReactDOM and ReactART which may
45
47
// not be the *best* abstraction for them.
46
48
47
49
// `this.node` in ReactDOM points to the DOM node of a component.
48
- // `getNativeNode` should return this.
50
+ // `getNativeNode`/`getHostNode` should return this.
49
51
this . node = null ;
50
52
// `this._mountImage` is the representation you use to render a ReactElement
51
53
// hierarchy. This could be an HTML string, a DOM node, or an identifier or
@@ -71,7 +73,11 @@ MinimumViableComponent.prototype = Object.assign(
71
73
mountComponent ( ) { } ,
72
74
receiveComponent ( ) { } ,
73
75
unmountComponent ( ) { } ,
74
- getNativeNode ( ) { }
76
+ // implement both of these for now. React <= 15.0 uses getNativeNode, but
77
+ // that is confusing. Host environment is more accurate and will be used
78
+ // going forward
79
+ getNativeNode ( ) { } ,
80
+ getHostNode ( ) { }
75
81
} ,
76
82
ReactMultiChild . Mixin
77
83
) ;
@@ -146,7 +152,7 @@ const TinyRendererComponentMixin = {
146
152
this . updateChildren ( nextElement . props . children , transaction , context ) ;
147
153
} ,
148
154
// there is no native node
149
- getNativeNode ( ) { } ,
155
+ getHostNode ( ) { } ,
150
156
// how do you unmount JSON?
151
157
unmountComponent ( ) { } ,
152
158
} ;
0 commit comments