I have an object:
{
name: 'someName:',
children: [],
description: 'someDescription'
}
And I want to push the same object to the children array, so it would become something like this:
{
name: 'someName:',
children: [
0: {
name: 'someName:',
children: [],
description: 'someDescription'
}
],
description: 'someDescription'
}
The children inside children will have the same structure, so as you can see it will need some kind of recursion logic. I'm trying to add form validation to each of these properties, but I'm unsure if this is possible with Formik.
Has anyone ever done this before and could they share an example or explain how they've done it?
question from:
https://stackoverflow.com/questions/65599575/is-it-possible-to-use-formik-recursively 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…