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.

[API] Support React.forwardRef component type

See original GitHub issue

Hello,

  • This is a v1.x issue (v0.x is no longer maintained).
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

The ButtonBase component shouldn’t trigger a warning when passing a value to its component prop.

Current Behavior

A warning is triggered : Warning: Failed prop type: Invalid prop component supplied to ButtonBase.

Steps to Reproduce (for bugs)

https://codesandbox.io/s/w6ln223vz5

Context

Your Environment

Tech Version
Material-UI v1.2.1
React v16.3.2

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
NMinhNguyencommented, Jun 23, 2018

@oliviertassinari

Are you interested in this task?

I am indeed 😃 Will try to prepare a PR in the next few days!

1reaction
oliviertassinaricommented, Jun 21, 2018

@NMinhNguyen Thanks for the link. Yes, it’s an opportunity to improve the component property type checking. Right now, it’s almost like we have an any. However, some work needs to be done to convert the package into a proptype that will be pruned in production. Are you interested in this task? 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Forwarding Refs - React
Ref forwarding is an opt-in feature that lets some components take a ref they receive, and pass it further down (in other words,...
Read more >
TypeScript + React: Typing Generic forwardRefs - fettblog.eu
Providing types for React.forwardRef is usually pretty straightforward. The types shipped by @types/react have generic type variables that ...
Read more >
Supporting React.forwardRef and Beyond | Flow - Medium
In Flow v0.89.0, we're releasing React.AbstractComponent, a new type that we use to model forwardRef and other React components.
Read more >
How to use React's forwardRef function | Felix Gerschau
Our task is to forward the ref that the Input component receives to the HTML input element. We do that by wrapping the...
Read more >
React/Typescript forwardRef types for an element which ...
While this by no means fixes the problem with React.forwardProps , an alternative would be to work around it and instead utilize an...
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