UNPKG

@wq/material-web

Version:

Web bindings for @wq/material

27 lines (26 loc) 721 B
import React from "react"; import { Field } from "formik"; import { TextField } from "formik-mui"; import { useHtmlInput } from "@wq/react"; import PropTypes from "prop-types"; export default function Input({ hint, inputProps, ...rest }) { const { name, type, maxLength } = useHtmlInput(rest); return /*#__PURE__*/ React.createElement(Field, { name: name, fullWidth: true, margin: "dense", component: TextField, helperText: hint, inputProps: { maxLength, ...inputProps, }, ...rest, type: type, }); } Input.propTypes = { name: PropTypes.string, hint: PropTypes.string, inputProps: PropTypes.object, };