mobx-react-form
mobx-react-form copied to clipboard
How to write computed field on nested row?
How to write computed field on nested row?
can you elaborate it better? thanks
I have: fields: [ 'position', 'description', 'diamonds', 'diamonds[].position', 'diamonds[].material_id', 'diamonds[].color_id', 'diamonds[].pcs' ] I want to add two calculated functions to diamonds array: this fields should not added to form values. 'diamonds[].pointer' 'diamonds[].weight'
Computed are only available when extending the form/field classes. Cannot be handled using only the form constructor. This is a codesandbox example with nested fields: https://codesandbox.io/s/mobx-react-form--computed-ee5kl1?file=/components/Form.js
Thanks for your reply.