mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-10-14 06:51:58 +00:00
More fixes for the React 16 update.
This commit is contained in:
parent
0ae6e5021d
commit
eb967e115f
9 changed files with 40 additions and 16 deletions
|
@ -74,7 +74,7 @@ export default class Fine extends Module {
|
|||
return instance.return;
|
||||
}
|
||||
|
||||
getHostNode(instance) {
|
||||
getParentNode(instance) {
|
||||
if ( instance._reactInternalFiber )
|
||||
instance = instance._reactInternalFiber;
|
||||
else if ( instance instanceof Node )
|
||||
|
@ -87,6 +87,23 @@ export default class Fine extends Module {
|
|||
instance = instance.parent;
|
||||
}
|
||||
|
||||
getChildNode(instance) {
|
||||
if ( instance._reactInternalFiber )
|
||||
instance = instance._reactInternalFiber;
|
||||
else if ( instance instanceof Node )
|
||||
instance = this.getReactInstance(instance);
|
||||
|
||||
while( instance )
|
||||
if ( instance.stateNode instanceof Node )
|
||||
return instance.stateNode
|
||||
else
|
||||
instance = instance.child;
|
||||
}
|
||||
|
||||
getHostNode(instance) {
|
||||
return this.getChildNode(instance);
|
||||
}
|
||||
|
||||
getParent(instance) {
|
||||
return this.getOwner(instance);
|
||||
}
|
||||
|
@ -424,8 +441,9 @@ export class FineWrapper extends EventEmitter {
|
|||
if ( instances )
|
||||
for(const inst of instances) {
|
||||
// How do we check mounted state for fibers?
|
||||
//if ( inst._reactInternalInstance && inst._reactInternalInstance._renderedComponent )
|
||||
// inst._ffz_mounted = true;
|
||||
if ( this.fine.getChildNode(inst) )
|
||||
inst._ffz_mounted = true;
|
||||
|
||||
_instances.add(inst);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue