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.

Cannot set data-testid into TextField after upgrading to Typescript 3.8.2

See original GitHub issue

I cannot do this anymore after upgrading Typescript to 3.8.2:

<TextField data-testid="usernameInput" />

The app fails to build:

Types of property 'data-testid' are incompatible.
Type 'string' is not assignable to type 'undefined'.

It used to work with Typescript 3.7.x

@material-ui/core version 4.9.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
akharkhonovcommented, Feb 27, 2020

@b1f6c1c4 this can help you

<TextField inputProps={{"data-testid":"usernameInput"}} />
1reaction
bobysf12commented, Feb 29, 2020

This problem is not reproducible anymore with typescript@3.8.3 Thank you @eps1lon for your response! I think I can close this for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot set data-testid into TextField after upgrading ... - GitHub
I cannot do this anymore after upgrading Typescript to 3.8.2: The app fails to build: Types of property 'data-testid' are incompatible.
Read more >
React testing library: The given element does not have a value ...
I want to change the value of material UI TextField in react testing library. I already set up the data-testid. Then using getByTestId...
Read more >
cypress-io/cypress - Gitter
Hi, I have a question regarding the progress of integration with browser stack, As my unit bought browserstack licenses and we would like...
Read more >
Changelog - Cypress Documentation
Fixed a regression introduced in the Electron browser in Cypress 10.8.0 where the CYPRESS_EVERY_NTH_FRAME environment variable was not being set appropriately ...
Read more >
How to Test React Components in TypeScript | Pluralsight
Using React Testing Library. Jest will take care of running tests and handling assertions but since we are testing React, we will need...
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