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.

Type error when setting component on DialogContentText

See original GitHub issue
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

This:

<DialogContentText component="div" />

Throws:

Property ‘component’ does not exist on type ‘IntrinsicAttributes & DialogContentTextProps & { children?: ReactNode; }’. TS2769

Expected Behavior 🤔

Should accept component as a valid prop

Steps to Reproduce 🕹

https://codesandbox.io/s/charming-mccarthy-mx1kf

Steps:

  1. Load sandbox URL
  2. Wait a while… takes long for the error to appear

image

Context 🔦

I want the component to be a div so I can put <ul> inside which would be invalid inside a <p>

Your Environment 🌎

Tech Version
Material-UI 4.8.2
React 16.12.0
Browser Chrome
TypeScript 3.7.4
{
    "compilerOptions": {
        "baseUrl": "src",
        "target": "es5",
        "lib": ["dom", "dom.iterable", "esnext"],
        "allowJs": true,
        "skipLibCheck": true,
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "strict": true,
        "forceConsistentCasingInFileNames": true,
        "module": "esnext",
        "moduleResolution": "node",
        "resolveJsonModule": true,
        "isolatedModules": true,
        "noEmit": true,
        "jsx": "preserve",
        "downlevelIteration": true,
        "importHelpers": true
    },
    "include": ["src"]
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shorncommented, Jan 5, 2020

Sounds like Drawer never took component in the first place, but it was implied by the doco that it did. If someone wants to refactor Drawer so that it does allow specification of a component - it seems like that should be a separate issue.

1reaction
shorncommented, Jan 4, 2020

Problem seems to have been introduced with 4.8.1 and affects other components like Drawer, see https://stackoverflow.com/q/59494907/924597

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type error when setting component on DialogContentText
The issue is present in the latest release. I have searched the issues of this repository and believe that this is not a...
Read more >
reactjs - Material-UI 4.8.1 API change - new way to specify the ...
What's the new way to specify way to specify the base component used by DialogContentText ? My project is a standard create-react-app setup, ......
Read more >
InputLabel API - Material UI - MUI
API reference docs for the React InputLabel component. ... Name, Type, Default, Description ... If true , the label is displayed in an...
Read more >
@material-ui/core DialogContentText JavaScript Examples
This page shows JavaScript code examples of @material-ui/core DialogContentText.
Read more >
Strapi API creation: A quick guide - LogRocket Blog
Adding a RESTful login dialog component; Switching from SQLite to PostgreSQL. Setting up the work environment. Strapi requires Node.js installed ...
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