Skip to content

Instantly share code, notes, and snippets.

@geball
geball / customArrayFunctions.js
Created June 4, 2021 15:14
Custom snippet to override the array function in Sanity.io
// Ported from https://gist.github.com/Grsmto/cc4db257d05898ca60a9572511fa9bcf and adapted to a functional component.
//
// Overrides the array's Add item button based on an integer-based validation rule.
//
// Add the following to sanity.json:
//
// {
// "implements": "part:@sanity/form-builder/input/array/functions",
// "path": "./src/components/customArrayFunctions.js"
// }