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

React Fiber - MenuItem not rendering due to findDOMNode #7025

Closed
bai opened this issue Jun 1, 2017 · 3 comments · Fixed by #7218
Closed

React Fiber - MenuItem not rendering due to findDOMNode #7025

bai opened this issue Jun 1, 2017 · 3 comments · Fixed by #7218
Labels
bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@bai
Copy link

bai commented Jun 1, 2017

Problem description

Modal-based components fail to render due to findDOMNode returning null in this line.

Possibly related to facebook/react#8905, facebook/react#9475, and facebook/react#8854

Versions

  • Material-UI: next
  • React: 16.0.0-alpha.12
  • Browser: Chrome 60
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work next labels Jun 1, 2017
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 2, 2017

Looks like an issue with the portal. I have the following error, the ref callback is called after componentDidUpdate. Notice that it's working fine with the stable release of React. The behaviour seems to have changed.

capture d ecran 2017-06-02 a 23 39 37

    return (
      <Portal
        open
        ref={node => {
          this.mountNode = node ? node.getLayer() : node;
        }}
      >
        <div
          data-mui-test="Modal"
          className={classNames(classes.modal, className)}
          ref={node => { // Called after componentDidUpdate
            this.modal = node;
          }}
          {...other}
        >
          {!disableBackdrop && this.renderBackdrop(backdropProps)}
          {modalChild}
        </div>
      </Portal>
    );

I have found a relevant issue: facebook/react#9808.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 21, 2017

I have managed to narrow down a minimal reproduction with the very same code, only the React version changed: (see the log messages after clicking on toggle).

I think that we can use @gaearon comment: facebook/react#9808 (comment), to write a cross next/latest Portal component.

@oliviertassinari oliviertassinari added the good first issue Great for first contributions. Enable to learn the contribution process. label Jun 21, 2017
@stefensuhat
Copy link
Contributor

I still get this issue on react 16 beta-5.

Material UI v1-beta-4. any fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants