react-native-root-siblings
Advanced tools
Comparing version 2.1.1 to 2.2.0
19
index.js
@@ -24,5 +24,3 @@ import React, { Component, cloneElement } from 'react'; | ||
super(props); | ||
this.state = { | ||
siblings: {} | ||
} | ||
this._siblings = {}; | ||
} | ||
@@ -39,6 +37,6 @@ | ||
_updatedSiblings = {}; | ||
_siblings = {}; | ||
_update = (id, element, callback) => { | ||
const siblings = { ...this.state.siblings }; | ||
const siblings = { ...this._siblings }; | ||
if (siblings[id] && !element) { | ||
@@ -48,12 +46,11 @@ delete siblings[id]; | ||
siblings[id] = element; | ||
this._updatedSiblings[id] = true; | ||
} | ||
this.setState({ | ||
siblings | ||
}, callback); | ||
this._updatedSiblings[id] = true; | ||
this._siblings = siblings; | ||
this.forceUpdate(callback); | ||
}; | ||
render() { | ||
const { siblings } = this.state; | ||
const siblings = this._siblings; | ||
const elements = []; | ||
@@ -88,3 +85,3 @@ Object.keys(siblings).forEach((key) => { | ||
const id = uuid++; | ||
function update (element, callback) { | ||
function update(element, callback) { | ||
triggers.forEach(function (trigger) { | ||
@@ -91,0 +88,0 @@ trigger(id, cloneElement(element, { |
{ | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"name": "react-native-root-siblings", | ||
@@ -4,0 +4,0 @@ "repository": { |
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
8323
85