Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RN] Support findNodeHandle in Fabric #12573

Merged
merged 1 commit into from Apr 8, 2018

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.

let findHostInstanceFabric = function(fiber: Fiber): any {
return null;
};

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.

None yet

3 participants