foxhound87 / mobx-react-form

Reactive MobX Form State Management
https://foxhound87.github.io/mobx-react-form
MIT License
1.09k stars 129 forks source link

TypeError: $field.$output is not a function #541

Closed riceyeh closed 3 years ago

riceyeh commented 4 years ago

Hi, I get a TypeError: $field.$output is not a function when running the following example. I find the $field here refers to customer.name, instead of customer.

describe('output goes wrong', () => {
    it.only('', () => {
        const fields = [
            'customer',
            'customer.name',
            'customerid'
        ];
        const labels = {
            'customer': 'Customer',
            'customer.name': 'name',
        };
        const output = {
            customer: c => c ? c.id : c
        };
        const values = {
            customer: {
                id: 'c-001',
                name: 'Allen'
            }
        }

        const $999 = new Form({fields, labels, output, values}, {name: 'Form 999', options:{fallback: false}});
        // expect(typeof $999.$('customer.name').$output).to.be.equal('function') // but it is 'string'
        $999.values(); // TypeError: $field.$output is not a function

    })
});
foxhound87 commented 3 years ago

:tada: This issue has been resolved in version 2.0.9 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

foxhound87 commented 2 years ago

:tada: This issue has been resolved in version 3.1.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: