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.

[InputLabel] does not accept prop "size" in TypeScript

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I add the prop size=“small” to an InputLabel component, and TypeScript complains:

image

Expected behavior 🤔

TypeScript should accept “size” as a prop, since the prop does what it is supposed to. It is simply not added to the typing.

Steps to reproduce 🕹

Steps:

  1. Add an <InputLabel> component to the app.
  2. Add size="small" as a prop to the component.
  3. The component renders as expected.
  4. TypeScript is not happy.

Context 🔦

No response

Your environment 🌎

`npx @mui/envinfo`

System: OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa) CPU: (12) x64 Intel® Core™ i7-10750H CPU @ 2.60GHz Memory: 28.06 GB / 31.23 GB Container: Yes Shell: 5.8 - /usr/bin/zsh Binaries: Node: 16.13.1 - /usr/local/bin/node npm: 8.1.2 - /usr/local/bin/npm Managers: Apt: 2.0.6 - /usr/bin/apt Utilities: Make: 4.2.1 - /usr/bin/make GCC: 9.3.0 - /usr/bin/gcc Git: 2.25.1 - /usr/bin/git Virtualization: Docker: 20.10.9 - /usr/bin/docker IDEs: Nano: 4.8 - /usr/bin/nano Vim: 8.1 - /usr/bin/vim Languages: Bash: 5.0.17 - /usr/bin/bash Perl: 5.30.0 - /usr/bin/perl Python: 2.7.18 - /usr/bin/python Python3: 3.8.10 - /usr/bin/python3 Browsers: Chrome: 98.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
hbjORbjcommented, Feb 16, 2022

I see. That’s interesting.

I will look into it and let you know.

2reactions
hbjORbjcommented, Feb 15, 2022

Hi. As you can see in InputLabel API doc, it doesn’t provide size prop. FormLabel, to which InputLabel is extended, also doesn’t provide size prop.

FormControl provides size prop as can be seen in its API doc. You may have been confused with this.

You can change the font-size of input label via sx prop. Check out https://codesandbox.io/s/composedtextfield-material-demo-forked-zk05i?file=/demo.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

InputLabel API - Material UI - MUI
API reference docs for the React InputLabel component. Learn about the props, CSS, and other APIs of this exported module.
Read more >
reactjs - How to pass input props to a component inside a ...
And inside my <InputField /> styled component i would like to do something like this: import styled from 'styled-components'; const { type }...
Read more >
React MUI InputLabel API - GeeksforGeeks
It determines whether the label should use the required class key or not. It is false by default. size: It sets the size...
Read more >
Input - Ant Design
autoSize prop for a textarea type of Input makes the height to automatically adjust based on the content. An option object can be...
Read more >
<Field /> | Formik
as can either be a React component or the name of an HTML element to render. Formik will automagically inject onChange , onBlur...
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