Skip to content

fix bug with inferno #291

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

Closed
wants to merge 0 commits into from
Closed

Conversation

mariusandra
Copy link
Contributor

Hey, I'm trying to migrate from React to InfernoJS. Everything works great, except somehow in componentWillUnmount the DOM is already gone (mapDom === null) and this line throws an exception.

@mariusandra
Copy link
Contributor Author

I think there was a typo there as well. addResizeListener should be removeResizeListener

@@ -328,10 +328,12 @@ export default class GoogleMap extends Component {
const mapDom = ReactDOM.findDOMNode(this.refs.google_map_dom);
window.removeEventListener('resize', this._onWindowResize);
window.removeEventListener('keydown', this._onKeyDownCapture);
mapDom.removeEventListener('mousedown', this._onMapMouseDownNative, true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why findDOMNode returns null on Inferno?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. Seems like a mistake with inferno. I reported it here: infernojs/inferno#590 . Not sure if/when it will be fixed.

window.removeEventListener('mouseup', this._onChildMouseUp, false);
window.removeEventListener('touchmove', this._onTouchMove);
detectElementResize.addResizeListener(mapDom, that._mapDomResizeCallback);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes looks like mistake

@istarkov
Copy link
Collaborator

Ill merge today evening or tomorrow morning, its fun to see that libraries work with inferno preact etc, wanna to play with too

window.removeEventListener('mouseup', this._onChildMouseUp, false);
window.removeEventListener('touchmove', this._onTouchMove);
detectElementResize.addResizeListener(mapDom, that._mapDomResizeCallback);
if (mapDom) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

could u add a comment that this check is for inferno support

@lock
Copy link

lock bot commented Dec 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants