Formik新手。我正在尝试对Formik发出的字段进行CSS格式化,但效果不佳。用一个方法包装每个字段是正确的吗?我希望将样式属性传递给,但它不接受。
发布于 2019-06-25 18:27:54
您可以传递className="your-class"
,然后根据需要设置类的样式。
<Field
className="main"
type="number"
name="numberInput"
... other props here ...
/>
将为您提供:
<input name="numberInput" class="main" type="number">
https://stackoverflow.com/questions/54043841
复制相似问题