The current behavior is to send relatively large chunks of information to the reducer.
For instance when dealing with an array of values the change is sent for the entire array. HandleChange computes change when it instead it could be sent to the reducer.
Dispatch and state is in the same context.
Desired Behavior
The desired behavior is to send "smaller" messages in order to let the reducer do the work.
Having dispatch and state in the same React context can if we believe this post impact performance.
Suggested Solution
Send messages such as :
'ARRAY_PUSH'
'ARRAY_SWAP'
'ARRAY_MOVE'
'ARRAY_INSERT'
'ARRAY_REPLACE'
'ARRAY_UNSHIFT'
'ARRAY_REMOVE'
'CHECKBOX_FLIP'
That way ArrayHelpers could contain less state.
Split Formik React context into two parts.
Who does this impact? Who is this for?
People who have very large forms using FieldArray. Removing return values from array helpers could change the API slightly. In order to avoid having an impact on people using specific parts of the FieldArray API you could have an alternate version with a slightly different API and a new name.
🚀 Feature request
Current Behavior
The current behavior is to send relatively large chunks of information to the reducer.
For instance when dealing with an array of values the change is sent for the entire array. HandleChange computes change when it instead it could be sent to the reducer.
Dispatch and state is in the same context.
Desired Behavior
The desired behavior is to send "smaller" messages in order to let the reducer do the work.
Having dispatch and state in the same React context can if we believe this post impact performance.
Suggested Solution
Send messages such as :
That way ArrayHelpers could contain less state.
Split Formik React context into two parts.
Who does this impact? Who is this for?
People who have very large forms using
FieldArray
. Removing return values from array helpers could change the API slightly. In order to avoid having an impact on people using specific parts of the FieldArray API you could have an alternate version with a slightly different API and a new name.Describe alternatives you've considered
Using a fork of Formik without regard for backwards compatibility (that can be used alongside Formik): https://github.com/wallymathieu/formik-reimagined
Additional context