Formik- Render FastField outside FORMIK with React Typescript

Viewed 13

I am trying to render a fastfield outside formik but it is saying that the fieldprops has any type

  export const RadioButton=({name, label, type, required,style,options} : radioProps)=>{
    return (
        <div>
          {required ? (
            <label className="form-label text-dark" style={style}>
              {label}
              <span className="text-danger ms-1">*</span>
            </label>
          ) : (
            <label className="form-control">{label}<span className="text-muted">(optional)</span></label>
          )}
        <div className="mb-3">
            <>
          <FastField className="form-control" name={name} id={name}  />
            {(fieldprops)=>(
<input type={type}/>
            )}
          <ErrorMessage name={name} className="text-danger" component="div" />
          </>
          </div>
        </div>
      );
  }
0 Answers
Related