xxxProps type error with data-* attribute
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 😯
When specifying PaperProps
there’s a type error.
Expected Behavior 🤔
There should be no type error.
Steps to Reproduce 🕹
https://codesandbox.io/s/material-demo-h11wl demo.tsx, row 55:
PaperProps={{ 'data-testid': '123' }}
Steps:
- Add the following the a Popover:
PaperProps={{ 'data-testid': '123' }}
Error:
Object literal may only specify known properties, and ‘‘data-testid’’ does not exist in type ‘Partial<PaperProps>’.ts(2769)
Context 🔦
Cypress needs selectors for targeting elements, and using a data-id
or data-testid
attribute is the preferred solution that doesn’t rely on styling selectors which might change over time.
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.8.0 |
React | v16.12.0 |
Browser | |
TypeScript | v3.7.3 |
etc. |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
xxxProps type error with data-* attribute · Issue #18874 - GitHub
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 >property 'children' does not exist on type 'intrinsicattributes'.ts ...
I had the following error when I use JSX sample code in TSX. (property) use:sortable: true Type '{ children: any; "use:sortable": true; class:...
Read more >New Validation Attributes in ASP.NET MVC 3 Future
Introduction: Validating user inputs is an very important step in collecting information from users because it helps you to prevent errors ...
Read more >Solved: Re: React Website + Marketo - Marketing Nation
When I try to render the component below, I get the error message "ReferenceError: MktoForms2 is not defined".
Read more >Setting up Play Framework 2.5.x with Hibernate OGM Neo4j
<persistence-unit name="defaultPersistenceUnit" transaction-type="RESOURCE_LOCAL"> ... <non-jta-data-source>DefaultDS</non-jta-data-source> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing this in favor of https://github.com/microsoft/TypeScript/issues/28960. Please upvote and subscribe to that issue instead if you’d like to see this fixed.
That’s the way I interpret it, at least 😕