Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
riceyeh opened this issue May 16, 2020 · 2 comments
Closed

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

riceyeh opened this issue May 16, 2020 · 2 comments
Labels

Comments

@riceyeh
Copy link
Contributor

riceyeh commented May 16, 2020

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 added a commit that referenced this issue Oct 1, 2020
@foxhound87
Copy link
Owner

🎉 This issue has been resolved in version 2.0.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

riceyeh added a commit to riceyeh/mobx-react-form that referenced this issue Nov 22, 2020
@riceyeh riceyeh mentioned this issue Nov 22, 2020
@foxhound87
Copy link
Owner

🎉 This issue has been resolved in version 3.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants