question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ButtonBase didn't accept function as component property

See original GitHub issue

In upgrading material v3.9.3 to v4.0.0 error happens. The error happens only in v4.0.0. I am trying to pass NavLink component to Tab.

ButtonBase.js:142 Uncaught (in promise) Error: Material-UI: expected an Element but found null. Please check your console for additional warnings and try fixing those. If the error persists please file an issue.

Wrapping NavLink with class component resolve this issue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hsimahcommented, May 27, 2019

Not sure what you’re referring to. The documented fix doesn’t use ref but innerRef for that exact reason. A future react-router version wouldn’t need innerRef anymore.

My code sample - I was using the incorrect prop name. All good, code working now.

1reaction
eps1loncommented, May 27, 2019

@eps1lon thanks, the ref prop on a NavLink is called innerRef not ref.

Not sure what you’re referring to. The documented fix doesn’t use ref but innerRef for that exact reason. A future react-router version wouldn’t need innerRef anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ButtonBase didn't accept function as component property
I am trying to pass NavLink component to Tab. ButtonBase.js:142 Uncaught (in promise) Error: Material-UI: expected an Element but found null.
Read more >
'styled()' function drops 'component' prop support
ButtonBase is working as expected, but suddenly there is an error from Typescript, telling that there is no 'component' prop on MyButton ....
Read more >
ButtonBase API - Material-UI
Name Type Default action func buttonRef union: func | object centerRipple bool false
Read more >
Making your components extensible with TypeScript
Adding custom properties. For the sake of simplicity, I'm going to introduce two props: id and onClick . We want the button to ......
Read more >
Higher-Order Components - React
Use HOCs For Cross-Cutting Concerns · Don't Mutate the Original Component. Use Composition. · Convention: Pass Unrelated Props Through to the Wrapped Component....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found