Material-ui: [Paper] Invalid prop for square property

Created on 12 Sep 2018  路  4Comments  路  Source: mui-org/material-ui

  • [x] This is not a v0.x issue.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior


According to documentation Paper component get boolean as a prop type for a square property.
If prop is false paper component should have sharp edges.

Current Behavior


Instead I get rounded edges, but if prop type is string (no need to be even "false") this is actually works for any string.
While providing boolean I get a warning in console:

Warning: Failed prop type: Invalid prop square of type string supplied to Paper, expected boolean.

Summary:
Expected boolean, works with string.
Throw console error with both types, string and boolean.

Steps to Reproduce


Link: https://codesandbox.io/s/3x6l25wm6q

First paper box is created as expected (boolean as a prop for square). As you can see It does not work.
Second paper box is sharp edges (as I'm expecting), but prop is not valid. It get's string not boolean.
PS. for second box you can type anything as square={"blabla"} also works.

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | v3.0.3 |
| React | v16.4.2 |
| Browser | latest chrome |

Paper question

Most helpful comment

Warning: Failed prop type: Invalid prop square of type string supplied to Paper, expected boolean.

All 4 comments

If聽true, rounded corners are disabled.

https://material-ui.com/api/paper/#props

Warning: Failed prop type: Invalid prop square of type string supplied to Paper, expected boolean.

I do not understand why this is closed. I am using the latest of React (16.8.4) and Material UI (3.9.2) and have been unable to make the square property work. I had to override it with: borderRadius: 0

Could you please explain how to make this work correctly?

@mviens Do you have a reproduction?

Was this page helpful?
0 / 5 - 0 ratings