Skip to content

Commit

Permalink
Merge branch 'main' into fb/make-formik-synchronous-when-validation-f…
Browse files Browse the repository at this point in the history
…unctions-are-sync
  • Loading branch information
fbarbare authored Oct 15, 2024
2 parents 9ae9a55 + 0e0cf9e commit a0b17a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,13 @@ const MyCheckbox = ({ children, ...props }) => {
);
};

const MySelect = ({ label, ...props }) => {
const MySelect = ({children, label, ...props }) => {
const [field, meta] = useField(props);
return (
<div>
<label htmlFor={props.id || props.name}>{label}</label>
<select {...field} {...props} />
{children}
{meta.touched && meta.error ? (
<div className="error">{meta.error}</div>
) : null}
Expand Down

0 comments on commit a0b17a6

Please sign in to comment.