In your documentation, you show managing the formsets by storing the constructed form in the state.
http://newforms.readthedocs.io/en/latest/formsets.html?highlight=formset
var ArticleFormSet = forms.FormSet.extend({form: Article})
var BookFormSet = forms.FormSet.extend({form: Book})
var PublicationManager = React.createClass({
getInitialState: function() {
return {
articleFormset: new ArticleFormSet({prefix: 'articles'})
, bookFormset: new BookFormSet({prefix: 'books'})
}
},
// ...rendering implemented as normal...
onSubmit: function(e) {
e.preventDefault()
var articlesValid = this.state.articleFormset.validate()
var booksValid = this.state.bookFormset.validate()
if (articlesValid && booksValid) {
// Do something with cleanedData() on the formsets
}
}
})
Is there a way we can do it via ref so we can reference the formset later and just allow the formset to render when the props update?
In your documentation, you show managing the formsets by storing the constructed form in the state.
http://newforms.readthedocs.io/en/latest/formsets.html?highlight=formset
Is there a way we can do it via ref so we can reference the formset later and just allow the formset to render when the props update?