• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

129
Views
Selectize js on calling change method giving undefined error when using with React Final Form

This is the error message I'm getting :

Cannot read properties of undefined (reading 'change')

enter image description here

This is how I'm calling selectize change method :

this.selectize.on('change', this.onChange);

Here, onChange is a prop, which calls the onSubmit method of react-final-form, and onSubmit definition is as below :

 const onSubmit = ({ content, url }, { reset }) => { 
    if (content) {
      const action = !content.get('campaignId') ? addContent : addCampaign;

      return action(content).then(() => {
        reset();

        if (contentSelector && contentSelector.current) {
          contentSelector.current.exclude(
            content.get('id') || content.get('campaignId')
          );
          contentSelector.current.selectize.blur();
        }
      });
    }

    if (url) {
      return addExternal(url).then(reset);
    }

    return null;
  };
almost 3 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error