Why Formik is throwing warning on buttons #3226
Replies: 1 comment
-
There isn't a way to disable it at the moment, and I agree it's kind of weird to display this helper message. I do agree that all buttons should have a type, but think a developer should opt in with an eslint rule because different teams have different conventions. I imagine this warning was created because a large number of developers opened an issue here about Formik supporting reset buttons. However, I don't feel like devtools is the best place to display this information anyway. I think it might be better to add an eslint rule. Something like this already exists, link below. The question is, how would we really get a user to enable this rule? I figure we could add some recommendations like https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/button-has-type.md |
Beta Was this translation helpful? Give feedback.
-
In my applications I have the habit to remove unnecessary attributes when they are set by default, and one of those is the type="submit" on buttons but I keep getting warnings in my console from it.
As specified in the RFC the type should always be submit as default.
I understand that there are new users using this library but shouldn't they adapt to html RFC ?
It is logged as a warning while it should only be an info message since it's in the RFC.
I looked into the code to check if there was a way to disable this "feature" but I didn't saw anything than changing the node env.
Beta Was this translation helpful? Give feedback.
All reactions