insin / newforms-examples

Examples repository for newforms / React
32 stars 7 forks source link

How to render individual custom fields? #1

Closed kevzettler closed 9 years ago

kevzettler commented 9 years ago

All the examples I'm seeing of using boundFields render a collection of fields using map.

I'm hoping to do something like:

        var fields = this.state.form.boundFieldsObj();
        CustomRenderfunction(bf){
          return <p><p>;
        }
        fields.myfieldname.render(CustomRenderFunction);
insin commented 9 years ago

You can get just the BoundField for a specific field using form.boundField(name)

CustomRenderFunction(this.state.form.boundField('myFieldName'));