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

Unknown prop `primary` on FloatingActionButton

Open BlockChange opened this issue 10 years ago • 4 comments

Version 15.4

When using primary prop on FloatingActionButton

Unknown prop primary on

BlockChange avatar Sep 29 '16 10:09 BlockChange

There is no primary property on FAB. The primary type is applied by default. If you need a primary FAB write it this way-

<FloatingActionButton style={style}>
      <ContentAdd />
</FloatingActionButton>

pratimary avatar Sep 29 '16 16:09 pratimary

@pratimary Is right, primary isn't supposed to have any effect. However, you can use the secondary property.

oliviertassinari avatar Sep 29 '16 21:09 oliviertassinari

Ok, clear. But I think it should be noted more cleary in the docs at the secondary perhaps?

But at the very least I think it should not give a unknown prop warning for it, maybe output a warning that specifically explains that it is primary by default.

BlockChange avatar Sep 30 '16 07:09 BlockChange

But at the very least I think it should not give an unknown prop warning for it

This warning is provided by React itself. I agree it could be improved. Actually, we have this property on the next branch. So we should be good now.

E.g. :

<Button fab primary>
  <span className="material-icons">add</span>
</Button>
<Button fab accent>
  <span className="material-icons">mode_edit</span>
</Button>

oliviertassinari avatar Oct 01 '16 15:10 oliviertassinari