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

Cannot use Material UI components in next/link on canary #7242

Closed
jaycenhorton opened this issue May 3, 2019 · 1 comment · Fixed by #7249
Closed

Cannot use Material UI components in next/link on canary #7242

jaycenhorton opened this issue May 3, 2019 · 1 comment · Fixed by #7249
Assignees

Comments

@jaycenhorton
Copy link

jaycenhorton commented May 3, 2019

Bug report

Describe the bug

Material UI components in next/link break next in the latest canary builds

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Use material UI 3.9.3
  2. Use next 8.1.1-canary-24
  3. Use a Material UI Component as the first child of <Link>
  4. See error

A code sandbox of the bug is available here: https://codesandbox.io/s/ll0qmmm0ql

Expected behavior

You should be able to use Material UI component as the first child in a Link just as before (i.e. as was possible in next@8)

Screenshots

next-link-bug

System information

  • Version of Next.js: 8.1.1-canary-24

Additional context

You can use a standard HTML element such as <div> (or another valid child such as <>) to wrap the Material UI child and the bug is subverted.

I think the bug was introduced by #7196 in canary-20.

The bug doesn't exist in canary-19 (after downgrading, using a material UI component as the first child works fine)

The error thrown in next build is

Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'
@oliviertassinari
Copy link
Contributor

Material-UI v3 components don't forward the ref to the DOM node. They do in v4.

@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2020
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 a pull request may close this issue.

4 participants