Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow validation errors in UpdateInputsWithError method to be React element #455

Closed
helluvalazyass opened this issue May 5, 2020 · 3 comments

Comments

@helluvalazyass
Copy link
Contributor

Strings in error messages works fine. But if the error message is a little complex and involves HTML tags (e.g. links), then I am not able to set the error message as it only allows string.
If there is any other way to set error messages that may contain HTML tags, please let me know.
Thanks.

@rkuykendall
Copy link
Member

That seems very valid! React.ReactNode would probably be the best option instead of Array<string | Element>, since it covers anything that can appear on the page. I can't, from memory, think of any reason this wouldn't be possible. It's likely just necessary for someone to change the types.

@helluvalazyass helluvalazyass changed the title Feature Request: Add (string | Element)[ ] type for errors in IUpdateInputsWithError interface Allow validation errors in UpdateInputsWithError method to be React element May 5, 2020
@rkuykendall
Copy link
Member

Released in formsy-react v2.0.3! Thank you for this improvement.

@helluvalazyass
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants