Comparing version 0.5.1 to 0.5.2
@@ -156,3 +156,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
if (this.props && this.props.ref) { | ||
this.props.ref(element); | ||
if (typeof this.props.ref === 'function') { | ||
this.props.ref(element); | ||
} | ||
else { | ||
this.props.ref.current = element; | ||
} | ||
} | ||
@@ -293,3 +298,8 @@ if (!noDispose && oldRoot && oldRoot instanceof ComponentNode_1.default) { | ||
if (oldRoot.props.ref) { | ||
oldRoot.props.ref(output); | ||
if (typeof oldRoot.props.ref === 'function') { | ||
oldRoot.props.ref(output); | ||
} | ||
else { | ||
oldRoot.props.ref.current = output; | ||
} | ||
} | ||
@@ -395,3 +405,8 @@ if (oldRoot.afterRender) { | ||
if (newRoot.props.ref) { | ||
newRoot.props.ref(oldElement); | ||
if (typeof newRoot.props.ref === 'function') { | ||
newRoot.props.ref(oldElement); | ||
} | ||
else { | ||
newRoot.props.ref.current = oldElement; | ||
} | ||
} | ||
@@ -398,0 +413,0 @@ } |
@@ -44,3 +44,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
if (this.props && this.props.ref) { | ||
this.props.ref(node); | ||
if (typeof this.props.ref === 'function') { | ||
this.props.ref(node); | ||
} | ||
else { | ||
this.props.ref.current = node; | ||
} | ||
} | ||
@@ -47,0 +52,0 @@ this.element = node; |
@@ -0,4 +1,5 @@ | ||
import Ref from './Ref'; | ||
export interface IVirtualNodeProps { | ||
key?: string | number; | ||
ref?: (node: Node) => void; | ||
ref?: Ref | ((node: Node) => void); | ||
} | ||
@@ -5,0 +6,0 @@ export interface IVirtualElementProps extends IVirtualNodeProps { |
@@ -53,3 +53,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
if (this.props && this.props.ref) { | ||
this.props.ref(node); | ||
if (typeof this.props.ref === 'function') { | ||
this.props.ref(node); | ||
} | ||
else { | ||
this.props.ref.current = node; | ||
} | ||
} | ||
@@ -56,0 +61,0 @@ this.element = node; |
@@ -15,2 +15,3 @@ import '../jsx/JSX'; | ||
export { Component } from '../dom/Component'; | ||
export { default as Ref } from '../dom/Ref'; | ||
export { default as Portal } from '../dom/Portal'; | ||
@@ -17,0 +18,0 @@ export { default as DecoratorUtil, ObservableFactory } from '../util/DecoratorUtil'; |
@@ -23,2 +23,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Component = Component_1.Component; | ||
var Ref_1 = require("../dom/Ref"); | ||
exports.Ref = Ref_1.default; | ||
var Portal_1 = require("../dom/Portal"); | ||
@@ -25,0 +27,0 @@ exports.Portal = Portal_1.default; |
{ | ||
"name": "cascade", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "A modern library for creating user interfaces.", | ||
@@ -5,0 +5,0 @@ "author": "Sean Johnson <sjohnson@sjohnsonaz.com>", |
@@ -217,3 +217,7 @@ import Cascade from '../cascade/Cascade'; | ||
if (this.props && this.props.ref) { | ||
this.props.ref(element); | ||
if (typeof this.props.ref === 'function') { | ||
this.props.ref(element); | ||
} else { | ||
this.props.ref.current = element; | ||
} | ||
} | ||
@@ -391,3 +395,7 @@ | ||
if (oldRoot.props.ref) { | ||
oldRoot.props.ref(output); | ||
if (typeof oldRoot.props.ref === 'function') { | ||
oldRoot.props.ref(output); | ||
} else { | ||
oldRoot.props.ref.current = output; | ||
} | ||
} | ||
@@ -509,3 +517,7 @@ | ||
if (newRoot.props.ref) { | ||
newRoot.props.ref(oldElement); | ||
if (typeof newRoot.props.ref === 'function') { | ||
newRoot.props.ref(oldElement); | ||
} else { | ||
newRoot.props.ref.current = oldElement; | ||
} | ||
} | ||
@@ -512,0 +524,0 @@ } |
@@ -58,3 +58,7 @@ import VirtualNode from './VirtualNode'; | ||
if (this.props && this.props.ref) { | ||
this.props.ref(node); | ||
if (typeof this.props.ref === 'function') { | ||
this.props.ref(node); | ||
} else { | ||
this.props.ref.current = node; | ||
} | ||
} | ||
@@ -61,0 +65,0 @@ this.element = node; |
@@ -0,4 +1,6 @@ | ||
import Ref from './Ref'; | ||
export interface IVirtualNodeProps { | ||
key?: string | number; | ||
ref?: (node: Node) => void; | ||
ref?: Ref | ((node: Node) => void); | ||
} | ||
@@ -5,0 +7,0 @@ |
import { IVirtualNode, IVirtualElementProps } from './IVirtualNode'; | ||
import Ref from './Ref'; | ||
@@ -65,3 +66,7 @@ export default class VirtualNode<T> implements IVirtualNode<T> { | ||
if (this.props && this.props.ref) { | ||
this.props.ref(node); | ||
if (typeof this.props.ref === 'function') { | ||
this.props.ref(node); | ||
} else { | ||
this.props.ref.current = node; | ||
} | ||
} | ||
@@ -68,0 +73,0 @@ this.element = node; |
@@ -18,2 +18,3 @@ import '../jsx/JSX'; | ||
export { Component } from '../dom/Component'; | ||
export { default as Ref } from '../dom/Ref'; | ||
export { default as Portal } from '../dom/Portal'; | ||
@@ -20,0 +21,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
403652
125
10732