Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Allow specification of id prop on ErrorMessage #2427
Comments
|
Let's say we have
So giving ErrorMessage an id prop will work for 1 out of 3 scenarios. |


Current Behavior
The type
ErrorMessagedoesn't have an id property.Desired Behavior
It'd be nice
id?: stringwould be added to the typeErrorMessageand set on the outermost component that serves as error message.Suggested Solution
Add
id={this.props.id}to the outer component inErrorMessage.Who does this impact? Who is this for?
This improves handling of error messages in e2e tests. It doesn't impact users in any way as the prop can still be omitted.
Describe alternatives you've considered
Wrapping
ErrorMessagein adivwhich has the sole purpose of providing the id which is not nice.Additional context
./.