Skip to content
New issue

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

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

Already on GitHub? # to your account

Hover Observer Breaks with React 16.5.0 #8

Closed
scottdickerson opened this issue Sep 7, 2018 · 2 comments
Closed

Hover Observer Breaks with React 16.5.0 #8

scottdickerson opened this issue Sep 7, 2018 · 2 comments

Comments

@scottdickerson
Copy link

scottdickerson commented Sep 7, 2018

To reproduce use the HoverObserver render prop with a component and upgrade to the new React 16.5.0 you'll see an error that breaks your UI.

Sample Code:

<ReactHoverObserver  onHoverChanged={this.handleHoverChanged}>
        {(
          { isHovering } //eslint-disable-line no-unused-vars
        ) => <MyComponent/>}</ReactHoverObserver>

Error:

aught TypeError: Class constructor ProxyComponent cannot be invoked without 'new'
    at mountIndeterminateComponent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:13600)
    at beginWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:13924)
    at performUnitOfWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:16249)
    at workLoop (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:16287)
    at HTMLUnknownElement.callCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:145)
    at Object.invokeGuardedCallbackDev (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:195)
    at invokeGuardedCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:248)
    at replayUnitOfWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:15578)
    at renderRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:16381)
    at performWorkOnRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:17220)
4webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:14389 The above error occurred in the <ReactHoverObserver> component:
    in ReactHoverObserver (created by WelcomeOption)
    in WelcomeOption (created by WelcomeDropdown)
    in div (created by WelcomeDropdown)
    in section (created by WelcomeDropdown)
    in Transition (created by CSSTransition)
    in CSSTransition (created by WelcomeDropdown)
    in WelcomeDropdown (created by InjectIntl(WelcomeDropdown))
    in InjectIntl(WelcomeDropdown) (created by Header)
    in Header (created by Route)
    in Route (created by withRouter(Header))
    in withRouter(Header) (created by InjectIntl(withRouter(Header)))
    in InjectIntl(withRouter(Header)) (created by HomeApp)
    in main (created by HomeApp)
    in HomeApp (created by Connect(HomeApp))
    in Connect(HomeApp) (created by InjectIntl(Connect(HomeApp)))
    in InjectIntl(Connect(HomeApp)) (created by Route)
    in Route
    in Router (created by BrowserRouter)
    in BrowserRouter
    in PersistGate
    in Provider
    in AppContainer
    in IntlProvider

@jacekradko
Copy link
Contributor

Here is the fix: #7

@ethanselzer
Copy link
Owner

Closing as fixed by #7. Thanks guys!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants