Closed AlexDunmow closed 7 years ago
Looks like there are still some flow errors though
|| foundNode instanceof Text
didn't work unfortunately, had to use type casting through any:
// eslint-disable-next-line flowtype/no-weak-types
return ((foundNode: any): ?HTMLElement);
didn't work unfortunately
What was the error?
Error: src/dom-manipulation.js:257
257: return foundNode;
^^^^^^^^^ Element. This type is incompatible with the expected return type of
233: export const getNativeNode = (element: ElementRef<*>): ?HTMLElement => {
^^^^^^^^^^^ HTMLElement
Ok, so Element is more generic than HTMLElement. We could probably do some duck-typing based on HTMLElement declaration, but I don't think it would be better than type casting
Cool, thanks!
Hey @AlexDunmow, this is released in 2.9.16
. Thanks again for your work on this!
I've sent you an invitation to add you as a collaborator. I've been giving contributors push access when they submit a high-quality PR, and yours certainly qualifies!
Of course it's 100% up to you how much work you want to put in; totally fine if you accept the invitation and then never touch the project :) I just want to make it easy for folks to contribute, if they want to.
The only rule is, please don't merge your own code unless I or one of the other collaborators has given it a ✅. Feel free to review/merge others' PRs, respond to issues, etc.
getNativeNode checks if element is instanceOf HTMLEment, which doesn't work if the FlipMove component is rendered inside an iFrame using React Portal.
Changed getNativeNode to check absolutely if node is a text node.
This is a resubmission, stopped jsprettier from polluting file and added type refinement to satisfy flow.