Capítulo 924 de 988
With this type, you can visually edit a matrix in the Props Editor.
const myCompSchema = z.object({
matrix: zMatrix(),
});
// Two-dimensional matrix
myCompSchema.parse({
matrix: [0, 1, 1, 0],
});
// Three-dimensional matrix
myCompSchema.parse({
matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1],
});
// Four-dimensional matrix
myCompSchema.parse({
matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
});