Open bpc1985 opened 1 year ago
The codesandbox you linked doesn't load and throws errors to the console (other than what you reported). I created another one (not using Projects) but it seems to work fine: https://codesandbox.io/s/friendly-chatterjee-423hmm?file=/DropdownList.tsx Could you take a look if I missed something?
The codesandbox you linked doesn't load and throws errors to the console (other than what you reported). I created another one (not using Projects) but it seems to work fine: https://codesandbox.io/s/friendly-chatterjee-423hmm?file=/DropdownList.tsx Could you take a look if I missed something?
Hi, I have already updated codesandbox: https://codesandbox.io/s/happy-beaver-xgjdhr?file=/App.tsx in github issue !
I also try to test your codesandbox and modifiy a little bit, it still show warning message in devtools
import { useState } from "react";
import { DropdownList } from "./DropdownList";
function App() {
const [selectedValue, setSelectedValue] = useState(2);
return (
<DropdownList
selectedValue={selectedValue}
onChange={(e) => {
setSelectedValue(Number(e.target.value));
}}
// listLabel="Test"
size="small"
options={[
{
label: "aaa",
value: 1
},
{
label: "bbb",
value: 2
}
]}
/>
);
}
export default App;
You can see that warning in following picture
notched
is a prop of the OutlinedInput. It does not exist on other variants.
notched
is a prop of the OutlinedInput. It does not exist on other variants.
I try to test like this
notched={ variant === 'outlined' }
even condition are true or false, it still generate warning
Warning: Received false
for a non-boolean attribute notched
.
Although type is (property) notched?: boolean
The type of the notched
props isn't precise - it doesn't take the variant
into consideration.
Try the following: notched={variant === 'outlined' ? true : undefined }
Thanks, using your code notched={variant === 'outlined' ? true : undefined }
works now !
:+1: anyway, I'll keep this issue open as it's an area for improvement.
Better use spread of props.
{...{ notched: false }} />
I had the same warning when using InputBase
to render the input
prop of Select
. Filtering it out of the props resolved the issue.
Duplicates
Latest version
Steps to reproduce 🕹
Link to reproduce: https://codesandbox.io/s/happy-beaver-xgjdhr?file=/App.tsx
Current behavior 😯
When trying to add notched property to Select component, it causes warning in devtools
Expected behavior 🤔
It should not show red warning
Context 🔦
No response
Your environment 🌎
``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```npx @mui/envinfo