Skip to content

Conversation

@sebmarkbage
Copy link
Collaborator

This doesn't actually need to share any state because it goes through the instance to the fiber structure. Since Fabric is on the same version as RN, calling it on either renderer works.

// Native
(typeof component === 'object' && '_nativeTag' in component) ||
// Composite
(component.render != null && typeof component.render === 'function'),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is always falsy according to the branch above. So never can pass. This must throw?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol. brb going to add a function to Number.prototype.render

@sebmarkbage sebmarkbage changed the title Support findNodeHandle in Fabric [RN] Support findNodeHandle in Fabric Apr 8, 2018
}
}

ReactFabric.render(<Component />, 11);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let inst =?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we wanted to get rid of that at some point. I should probably use a ref though.

};

export function injectFindHostInstance(impl: (fiber: Fiber) => any) {
findHostInstance = impl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these not overwrite each other if called twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're in separate bundles but I'm going to do a follow up that doesn't use injection and uses instantiation instead.

This doesn't actually need to share any state because it goes through
the instance to the fiber structure. Since Fabric is on the same version
as RN, calling it on either renderer works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants