2,850 questions
0
votes
1
answer
86
views
How to reuse a custom InputField component?
I’m migrating my forms in a Next.js 15 project from native form handling to Formik, and I want to reuse my custom form components (InputField, Dropdown, TextArea, etc.).
Here is my current InputField ...
0
votes
0
answers
37
views
Sorting in Custom MUI Table with Formik Editable Fields is very slow
I have an InvoiceTable component and a custom editable invoice field.
I am using Formik, and I am calculating an initialSortedData before Formik is initialized.
Once Formik is initialized, all data, ...
0
votes
0
answers
48
views
Formik Field component FieldInputProps<string> not working properly with ShadCN Input OTP component
I have tried with children method and with component method, but in both cases onChange={field.onChange} or {...field} doesnt update the field on input.
<Field
name={"otp"}
component={...
0
votes
0
answers
16
views
How to get only edited values in react formik?
I was trying to make edit request to BE(Back End) and I don't have to give not edited values to the BE.
const handleEdit = async (values: typeof initials) => {
--------------------------------...
0
votes
0
answers
53
views
How can I set auto-complete in a Formik Form built with a react-select component (TS)?
I'm currently using a Formik Form in which my Field is built with a Select component from react-select.
I've got something like this:
<Formik initialValues=[...]}
onSubmit={onSubmit}...
0
votes
0
answers
95
views
Button type submit not triggering the onSubmit function
I am trying to submit the form values. I had defined the initial values and using the controlled input. When I am clicking on the Register button the onSubmit is not triggering. On clicking of the ...
0
votes
0
answers
37
views
React hook form in react native, dynamic form
I need to build a form using react hook form where user can add multiple dates and a particular dates can have any number of events
My form code is
const { control, setValue, getValues } = useForm&...
1
vote
1
answer
46
views
MUI DateTimePicker resets itself when in SidePanel component
I'm having a problem with the DateTimePicker being inside a SidePanel in my project.
It resets itself when trying to type in a value.
(While creating the sandbox, it worked ONCE outside the SidePanel ...
2
votes
1
answer
88
views
Button not triggering form submission
I’m encountering an issue with a save button in my form. I have a SaveButton component that is supposed to trigger a form submission when clicked. The button is linked to Formik’s submitForm function, ...
0
votes
1
answer
86
views
Formik not submit
Formik not submit the form when click at submit button. The handleSubmit() isn't being called, nether putting a console.log() or alert() directly at onSubmit.
I am using PrimeReact 10.8.3, React 18.3....
1
vote
1
answer
338
views
How to use yup async validation with formik and React and avoid to see first required validation
I have React application with formik and yup for building forms.
I need create form with list of inputs, with codes and there must be async validations for API, which will confirm if the code exists.
...
0
votes
1
answer
82
views
Adding custom validations when integrating Input with React Hook Form using Controller
I am trying to use React Hook Form to setup a custom input field and thus use the useForm hook as below;
const {
control,
handleSubmit,
register,
formState,
...
1
vote
0
answers
59
views
Yup Formik Validation Not Working with react-number-format for custom component
I’m integrating react-number-format into a Formik form for handling numeric inputs with formatting (e.g., decimal points and thousands separators). However, after integrating react-number-format, my ...
0
votes
1
answer
340
views
I have a problem in yup validation when adding required and default value
My problem is I add validation schema on my formik form but the required() validation does not work if I put default("mmm") value
<Formik
initialValues={validtionShema.cast()}
...
2
votes
1
answer
60
views
Required Fields Based on other Field in React, Yup and Formik
I have a problem requiring the account_id field when mode_of_payment has a value.
My code below still doesn't make the account_id required when mode_of_payment has been filled out. mode_of_payment isn'...
0
votes
1
answer
43
views
Imported package is undefined eventhough it is in the node modules
I am working on react-native application. Like all JS frameworks, I have installed the packages such as formik, react-native-calendars here also. And it is visible in package.json. And also I have ...
1
vote
0
answers
27
views
Formik: Nested Object Update - Updating Field Within Nested Object Instead of Creating Separate Objects
In a React application using Formik, I have a nested object structure representing hardware parts within a form.
export const formValues = {
client: {
firstName: '',
lastName: '',
email: ...
0
votes
2
answers
97
views
I don't understand why Yup is casting this value as an array
I'm fairly new to Formik and Yup. I'm confused on why the selectedJobType is being typed as an array in my conditional for the languages validation. jobType is a string from a select box, so I would ...
0
votes
1
answer
29
views
How to reset to initial state upon clicking windows back button or changing route?
features/productSlice.js
export const resetState = createAction("Reset_all")
const initialState = {
products: [],
product: {},
productImages: [],
isError: false,
...
1
vote
1
answer
240
views
How to use yup in stepper form
I make a stepper formik form and the objective is yup should validate each step of the form. this is my validation schema:
const schema = [
yup
.object()
.shape({
field1: yup.string().required(...
0
votes
1
answer
109
views
I want to disable the Formik validation when loading a modal
I am using Formik and Yup in my React Typescript project , I have a modal that will save a new value , I added Formik Validation to the Fields in my modal but when I click the add button in my page to ...
0
votes
1
answer
87
views
handleSubmit React Native Formik
Reference Image to Code
Error Statement
Hi Im trying to create a Login page for an IOS app using React Native. Was following online guides and used Formik for validation. However, I ran into an issue ...
0
votes
1
answer
254
views
Formik Error: Cannot read properties of undefined (reading 'validateOnChange') using Dynamic Inputs
I'm trying to dynamically add some input fields based on the number on one field setNoOfVessels, I'm trying to use the FieldArray component from Formik to achieve this:
const validationSchema = ...
2
votes
1
answer
77
views
Radio Button Select in Table in React
I'm using React, MUI and Formik.
I have a table and how do I allow that only one radio would be selected by row?
This is my codesandbox: CLICK HERE
import { TableCell, TableRow, Radio } from "@...
1
vote
2
answers
982
views
React Testing Library: Input Field Not Updating Value in Tests
I'm working with a custom React component that wraps an Office UI Fabric TextField within a Formik form. Despite following typical patterns for handling input fields with React and Formik, I'm ...