material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

IconButton unknown props warning

Open StefanAlves opened this issue 10 years ago • 6 comments

Problem description

A warning is raised for unknown props when I pass tooltipStyles for IconButton.

The issue is related to #4594

Steps to reproduce

To reproduce this issue you just have to pass an object for the tooltipStyles prop. Ex:

<IconButton tooltipStyles = { myStyles } >....

Versions

  • Material-UI: 0.15.2

StefanAlves avatar Jul 29 '16 14:07 StefanAlves

I'm still seeing the warnings in version 0.15.3 for disabledBackgroundColor and disabledLabelColor properties of the RaisedButton component.

carlgunderson avatar Aug 04 '16 21:08 carlgunderson

I'm getting a similar warning for the primary prop with IconButton.

Unknown prop `primary` on <button> 

ryanblakeley avatar Nov 21 '16 20:11 ryanblakeley

I'm getting:

Unknown prop `raised` on <button> 

hackingbeauty avatar Dec 15 '16 06:12 hackingbeauty

@StefanAlves I tried using the tooltipStyles prop in IconButton and it works just fine. I will post the code I used to reproduce the issue.

import React, {Component} from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import IconButton from 'material-ui/IconButton';
import FontIcon from 'material-ui/FontIcon';
import ActionHome from 'material-ui/svg-icons/action/home';
import injectTapEventPlugin from 'react-tap-event-plugin';
import './App.css'

injectTapEventPlugin();

const styles = {
 boxSizing: 'border-box',
 paddingLeft: '30px',
 border: "1px solid #979797",
 backgroundColor: "#0000FF",
};


class Child extends Component{
	render(){
		return(
		  <MuiThemeProvider>
		      <div>
                         <IconButton tooltipStyles= {styles} tooltip="Font Icon">
                             <FontIcon className="icon-home" />
                         </IconButton>
		      </div>
		  </MuiThemeProvider>
		)
	}
}


export default Child

@carlgunderson If you update your material-ui version to the latest release 0.17.0, you will stop seeing the warning as it was fixed in a later release.

@rojobuffalo primary is not a prop of IconButton so you will see the warning.

@hackingbeauty raised' is not a prop of IconButton` so that warning is expected. If you saw that warning for something else, please elaborate for a better answer.

Shahrukh-Zindani avatar Feb 20 '17 22:02 Shahrukh-Zindani

@oliviertassinari This issue can be closed if there is no further discussion.

Shahrukh-Zindani avatar Feb 20 '17 22:02 Shahrukh-Zindani

@Shahrukh-Zindani Looking at the source code, it should be fine. Thanks.

oliviertassinari avatar Feb 20 '17 22:02 oliviertassinari