fix(renderer): Remove redundant indexing logic from data type validation#1565
Merged
Hyperkid123 merged 1 commit intodata-driven-forms:masterfrom Feb 16, 2026
Conversation
|
@asirvadAbrahamVarghese is attempting to deploy a commit to the data-driven-forms Team on Vercel. A member of the Team first needs to authorize it. |
| return [ | ||
| ...(validate ? validate.map((validator) => prepareValidator(validator, convertedMapper)) : []), | ||
| ...(dataType ? [dataTypeValidator(dataType)[dataType]()] : []), | ||
| ...(dataType ? [dataTypeValidator(dataType)() as unknown as ValidatorFunction] : []), |
Contributor
Author
There was a problem hiding this comment.
Since I can’t eliminate the type mismatch, I’m first casting the value to unknown and then explicitly typing it as ValidatorFunction
Hyperkid123
approved these changes
Feb 16, 2026
Member
|
Thank you @asirvadAbrahamVarghese for the fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #(issue) (if applicable)
Description
App throws a runtime error while rendering a field with a schema that contains
dataTypepropertyPlease include a summary of the change.
dataTypeValidator already performs the indexing and returns the required validator factory function.
getValidateredundantly attempts to access the factory via indexing again(see) -dataTypeValidator(dataType)[dataType]().Since the value returned by
dataTypeValidatoris already the resolved factory, this second indexing operation evaluates toundefined, leading to a runtime crashRemoving the redundant second indexing resolves the issue:

Schema (if applicable)
Checklist: (please see documentation page for more information)
Yarn buildpassesYarn lintpassesYarn testpassesfix|feat({scope}): {description}fix(pf3): wizard correctly handles next buttonFix button on documenation example page